I want to change the default directory for creating migration i.e. If I do php artisan make:migration create_users_table
, it should create users table in /database/migrations/child_database
. I do not want to use –path every time I create a migration for child_database. I want to change the default directory for php artisan make:migration
.
3
Answers
you can create your own artisan command to achieve this:
create your a new artisan command and use it to make migration in your custom directory using this article. hope help you ^_^
try this package github repo or use laracast link
You can use loadMigrationsFrom() in your AppServiceProvider.
Inside the boot() function, run:
This question has been answered before, even though it’s a little bit old it still has it’s value.
Have a look at: https://stackoverflow.com/a/35895106
If you use this answer, the default directory is changed and you will have the solution you want.