Home » Php » Scaffold Controller Laravel 5.2 Artisan

Scaffold Controller Laravel 5.2 Artisan

Posted by: admin November 29, 2017 Leave a comment

Questions:

I am running following command:

php artisan make:controller UserController

This is successfully creating Controller but I want to scaffold it with all the basic methods. How can I do that?

Answers:

try this one

php artisan make:controller UserController --resource

shorthand

php artisan make:controller UserController -r


For Laravel 5.4:

Additional option has been added.

php artisan make:controller UserController -m=[MODEL_NAME]

this will make controller with all the resource method and corresponding model