Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scaffold Controller Laravel 5.2 Artisan

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?

like image 339
Awn Ali Avatar asked Dec 14 '22 09:12

Awn Ali


1 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

like image 142
ssuhat Avatar answered Dec 25 '22 10:12

ssuhat