How to use Artisan make:Migration in a subdirectory with Laravel 5

Asked

Viewed 201 times

1

I am starting to build an extremely robust application using Laravel 5 and need to organize all my table migration codes. My solution was to structure subfolders to facilitate the understanding and modularization of this application. The problem is that I can’t create my Migrations within "Migrations' subdirectories".

What I’m looking for is something like this:

php artisan make:migration Foo/create_table_foo
php artisan make:migration Foo/upgrade_table_foo

The problem is that I cannot generate this type of structure, by doing this Artisan inserts the date in the folder name and says that it could not find the directory. How to solve?

1 answer

1


I found a solution directly in the documentation. I must use the method --path saying which directory will be saved to the Migrations. So:

php artisan make:migration create_table_foo --path=database/migrations/Foo

Browser other questions tagged

You are not signed in. Login or sign up in order to post.