Creating everything within one command

There is a magic configuration which helps to create everything such as controller, resource controller, model, migration, factory, seeder, request, policy within one command and it is given below

php artisan make:model Article -a


After executing above command it will create following files:

1. ArticleController.php ( resource controller with 7 methods index, create, store, edit, update, show and destroy )
2. StoreArticleRequest.php ( this will be also added into controller store method )
3. UpdateArticleRequest.php ( this will be also added into controller update method )
4. Model/Article.php
5. database/migrations/create_articles_table.php
6. database/factory/ArtcileFactory.php
7. database/seeder/ArticleSeeder.php
8. Policies/ArticlePolicy.php

So, everything will be created with that one configuration which will help to move forward to building business logic as soon as possible.

Related Posts