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
.
Asked
Active
Viewed 114 times
0

Engr. Umar Ejaz
- 106
- 1
- 6
3 Answers
0
try this package github repo or use laracast link
You can use loadMigrationsFrom() in your AppServiceProvider.
Inside the boot() function, run:
/**
* Register Custom Migration Paths
*/
$this->loadMigrationsFrom([
database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'folder1',
database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'folder2',
]);/

Ramil Huseynov
- 350
- 4
- 7
0
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.

Erik Dohmen
- 267
- 1
- 6