Creating migration, controller, factory, seeder with Model

With php artisan command creating migration, controller, factory, seeder with Model is a piece of cake. It can be done with following snippet

php artisan make:model Post -mcrfs


After executing above command it will create following files:

1. PostController.php ( resource controller with 7 methods index, create, store, edit, update, show and destroy )
2. Model/Post.php
3. database/migrations/create_posts_table.php
4. database/factory/PostFactory.php
5. database/seeder/PostSeeder.php

Related Posts