Is there a team in Laravel that can create a migration, model, and controller in 1 artisan team?

The main question is already in the title.

I'm using Laravel 5.4 right now, there is something like

php artisan make:model Category --migrations --controller 

and can generate:

create_categories_table.php [migration]

Category.php [model]

CategoryController

+5
source share
2 answers

You almost guessed the right answer. Yes, you can make a model + migration + controller, all on one line using the command:

php artisan make:model --migration --controller Test

Short version: php artisan make:model -m -c Test

Result:

 Model created successfully. Created Migration: 2017_02_27_153716_create_tests_table Controller created successfully. 

For additional syntax, use the -h or --help flag with the make:model command, it will show all available options for this command. You can also create not just an empty controller, but a resource controller with predefined CRUD methods. To do this, use the optional -r or --resource flag.

+7
source

There is another option, and I think it's awesome, it's called: Laravel Generator from InfyOM Labs

With a single line of code, you can generate:

  • Migration
  • Model
  • Request

and many other options

0
source

Source: https://habr.com/ru/post/1264788/


All Articles