-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.

3

5 Answers 5

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

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

0

php artisan make:model -mcr Task

You will get all file in one command.

Comments

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

Comments

-2
php artisan make:migration create_products_table //create only Migration file
php artisan make:model Product -m //Create Migration, Model file
php artisan make:model Product -mcr //For Create Migration,Model,Controller with resource

1 Comment

How is this answer better than the other answers? Could you add more information or an explanation?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.