上QQ阅读APP看书,第一时间看更新
Creating controllers
Now it is time to use the artisan to generate our controller, let's see how we can do that:
- Go back to the Terminal window, and type the following command:
php artisan make:controller BandController
After the command, you should see a message in green, stating: Controller created successfully.
- Now, inside app/Http/Controllers, you will see BandController.php, with the following content:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
class BandController extends Controller
{
//
}
As a good practice, always create your controller with the suffix <Somename>Controller.