Skip to content

Commit 13ec27b

Browse files
committed
[fix] fix register only enable module migrations
1 parent 27d90b2 commit 13ec27b

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/LaravelModulesServiceProvider.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,10 @@ protected function registerMigrations(): void
105105
}
106106

107107
$this->app->resolving(Migrator::class, function (Migrator $migrator) {
108-
$path = implode(DIRECTORY_SEPARATOR, [
109-
$this->app['config']->get('modules.paths.modules'),
110-
'*',
111-
'[Dd]atabase',
112-
'migrations',
113-
]);
114-
115-
collect(glob($path, GLOB_ONLYDIR))
116-
->each(function (string $path) use ($migrator) {
117-
$migrator->path($path);
108+
$migration_path = $this->app['config']->get('modules.paths.generator.migration.path');
109+
collect(\Nwidart\Modules\Facades\Module::allEnabled())
110+
->each(function (\Nwidart\Modules\Laravel\Module $module) use ($migration_path, $migrator) {
111+
$migrator->path($module->getExtraPath($migration_path));
118112
});
119113
});
120114
}

0 commit comments

Comments
 (0)