When generating a controller from the command line (php artisan make:controller
), you'll now find a new --model
flag. When called with the name of a model, Laravel will automatically generate a resourceful controller that includes the necessary boilerplate to inject this model in all relevant controller actions.