FavoriteLoadingAdd to favorites

————————————–
To create your model and controller together you can do this.
Method 1 : Does not set controllers as resource items.
php artisan make:controller CustomersController –model=Customer

Method 2 : Sets controllers as resource items.
php artisan make:model Todo -mcr

————————————–
-m, –migration Create a new migration file for the model.
-c, –controller Create a new controller for the model.
-r, –resource Indicates if the generated controller should be a resource controller

————————————–
For reference sake this is the method where you manually create each method for Model and Controller

The –resource sets up by default the controllers crud functionalities

php artisan make:model Customer
php artisan make:controller CustomersController --resource

https://stackoverflow.com/questions/43187735/laravel-5-4-create-model-controller-and-migration-in-single-artisan-command

The below is an example from Laravel.

php artisan make:model Flight --factory
php artisan make:model Flight -f

php artisan make:model Flight --seed
php artisan make:model Flight -s

php artisan make:model Flight --controller
php artisan make:model Flight -c

php artisan make:model Flight -mfsc

Pin It on Pinterest

Share This