I can create a model and resource controller (binded to model) with the following command
php artisan make:controller TodoController --resource --model=Todo
You can make model + migration + controller, all in one line, using this command:
php artisan make:model --migration --controller test
Short version: php artisan make:model -mc test
Output :-
Model created successfully.
Created Migration:2018_03_10_002331_create_tests_table
Controller created successfully.
If you need to perform all CRUD operations in the controller then use this command:
php artisan make:model --migration --controller test --resource
Short version: php artisan make:model -mc test --resource
Just Try this command on your terminal
php artisan make:model Todo -mcr
Below the output and your Model, Controller with Resource and Migration file will create...
Model created successfully. Created Migration: 2019_12_25_105305_create_todos_table Controller created successfully.
To make all 3: Model, Controller & Migration Schema of table
write in your console: php artisan make:model NameOfYourModel -mcr
You can do it with the following command:
php artisan make:model post -mcr
Brief :
-m, to create migration
-c to create controller
-r to specify the controller has resource
You can use -m -c -r to make migration, model and controller.
php artisan make:model Post -m -c -r
php artisan make:model PurchaseRequest -crm
The Result is
Model created successfully.
Created Migration: 2018_11_11_011541_create_purchase_requests_table
Controller created successfully.
Just use -crm instead of -mcr