Skip to content

Commit cf0c963

Browse files
committed
Change migration path
1 parent af1f9c3 commit cf0c963

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Filament2faServiceProvider.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,20 @@ public function packageBooted(): void
4646

4747
protected function publishMigrations()
4848
{
49-
$files = Collection::make(File::files(base_path('vendor/laragear/two-factor/database/migrations')))
49+
$path = __DIR__ . '/../vendor/laragear/two-factor/database/migrations';
50+
51+
if (!is_dir($path)) {
52+
// Don't throw if the package isn't installed or path is invalid in CI
53+
return;
54+
}
55+
56+
$files = Collection::make(File::files($path))
5057
->mapWithKeys(fn(\SplFileInfo $file): array => [
5158
$file->getRealPath() => Str::of($file->getFileName())
5259
->prepend($this->app->databasePath('migrations/'))
5360
->toString(),
5461
]);
62+
5563
$this->publishes($files->toArray(), 'filament-2fa-migrations');
5664
}
5765

0 commit comments

Comments
 (0)