-1

php artisan make:model -mcr Task

Model created successfully. Created Migration: 2018_08_16_082225_create_tasks_table Controller created successfully.

You will get all file in one command.

ganesh y
  • 25
  • 1
  • 3
  • I tried in laravel 5.5 and above version. – ganesh y Aug 16 '18 at 08:29
  • Reference this link: https://stackoverflow.com/questions/43187735/laravel-5-4-create-model-controller-and-migration-in-single-artisan-command – Khine Thu Aug 16 '18 at 09:01
  • Does this answer your question? [Laravel - create model, controller and migration in single artisan command](https://stackoverflow.com/questions/43187735/laravel-create-model-controller-and-migration-in-single-artisan-command) – Arman H Mar 14 '22 at 01:35

4 Answers4

5

The below Command will create the model, Controller, Factory, migration and Seeder.

php artisan make:model ModelName -a

-a stands for all (Model, controller, factory, Migration and Seeder)

Note: The above command will work successfully in Laravel 5.5 or > versions

Salman Zafar
  • 3,844
  • 5
  • 20
  • 43
1

You can use this command for create model and controller and migration at same time:( You can use --migration Instead of -m and you can use --controller Instead of -c)

php artisan make:model MODEL_NAME -c -m

or you can use for create model , controller ,migration and factory at same time ( Youc can use --all Instead of -a):

php artisan make:model MODEL_NAME -a
0

php artisan make:model -mcr Task

You will get all file in one command.

ganesh y
  • 25
  • 1
  • 3
0

you can make model + migration + controller, all in one line, reference this link

Laravel 5.4 create model, controller and migration in single artisan command

Khine Thu
  • 139
  • 10