Skip to content
This repository was archived by the owner on Jun 1, 2019. It is now read-only.

Commit 0a64977

Browse files
committed
Merge pull request #35 from themsaid/fix-republishing-migration
Fix issue #34 with publishing the migration file on each vendor:publish
2 parents 3bc6e0a + 8be3012 commit 0a64977

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Spatie/Activitylog/ActivitylogServiceProvider.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ public function boot()
2323
__DIR__.'/../../config/activitylog.php' => config_path('activitylog.php'),
2424
], 'config');
2525

26-
// Publish your migrations
27-
$timestamp = date('Y_m_d_His', time());
26+
$files = glob(database_path('/migrations/*_create_activity_log_table.php'));
2827

29-
$this->publishes([
30-
__DIR__.'/../../migrations/create_activity_log_table.stub' => database_path('/migrations/'.$timestamp.'_create_activity_log_table.php'),
31-
], 'migrations');
28+
if (! $files) {
29+
// Publish your migrations
30+
$timestamp = date('Y_m_d_His', time());
31+
32+
$this->publishes([
33+
__DIR__.'/../../migrations/create_activity_log_table.stub' => database_path('/migrations/'.$timestamp.'_create_activity_log_table.php'),
34+
], 'migrations');
35+
}
3236
}
3337

3438
/**

0 commit comments

Comments
 (0)