Skip to content

Commit 98f1cfd

Browse files
Merge pull request #692 from owen-it/not_publishing_migration_if_exist
Dont publish migration if migration exists
2 parents 600b923 + f73489e commit 98f1cfd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/AuditingServiceProvider.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
use Illuminate\Contracts\Support\DeferrableProvider;
66
use Illuminate\Support\ServiceProvider;
7-
8-
use OwenIt\Auditing\Contracts\Auditor;
97
use OwenIt\Auditing\Console\AuditDriverCommand;
108
use OwenIt\Auditing\Console\InstallCommand;
9+
use OwenIt\Auditing\Contracts\Auditor;
1110

1211
class AuditingServiceProvider extends ServiceProvider implements DeferrableProvider
1312
{
@@ -52,11 +51,13 @@ private function registerPublishing()
5251
__DIR__ . '/../config/audit.php' => base_path('config/audit.php'),
5352
], 'config');
5453

55-
$this->publishes([
56-
__DIR__ . '/../database/migrations/audits.stub' => database_path(
57-
sprintf('migrations/%s_create_audits_table.php', date('Y_m_d_His'))
58-
),
59-
], 'migrations');
54+
if (!class_exists('CreateAuditsTable')) {
55+
$this->publishes([
56+
__DIR__ . '/../database/migrations/audits.stub' => database_path(
57+
sprintf('migrations/%s_create_audits_table.php', date('Y_m_d_His'))
58+
),
59+
], 'migrations');
60+
}
6061
}
6162
}
6263

0 commit comments

Comments
 (0)