- Hands-On Full Stack Web Development with Angular 6 and Laravel 5
- Fernando Monteiro
- 90字
- 2021-07-23 19:18:46
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.