sbkl's avatar
Level 17

laravel controller Specifying The Resource Model AND migration?

Laravel 5.4 provides the useful way to create a model related to controller all together.

php artisan make:controller PhotoController --resource --model=Photo

A very handful way of creating a migration related to a model was to use

php artisan make:model Photo -m

The '-m' parameter enabling to create the related migration file to the model created.

Is there a command to create the controller, model and migration all together?

0 likes
5 replies
Snapey's avatar

php artisan make:model Photo -m -c

sbkl's avatar
Level 17

@Snapey thanks for the answer. Still this is not taking advantage of the new resourceful controller command.

Snapey's avatar

Do you sometimes wonder if you worry about the wrong things?

1 like
Jaytee's avatar
Jaytee
Best Answer
Level 39

Bang bang bang : php artisan make:model ModelName -m -cr

creates migration, model and controller and populates the controller with resource methods.

Obama Out!

2 likes

Please or to participate in this conversation.