Ad

Scaffold Controller Laravel 5.2 Artisan

- 1 answer

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?

Ad

Answer

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

Ad
source: stackoverflow.com
Ad