Skip to content

Commit

Permalink
Merge pull request #692 from owen-it/not_publishing_migration_if_exist
Browse files Browse the repository at this point in the history
Dont publish migration if migration exists
  • Loading branch information
anteriovieira authored Feb 22, 2022
2 parents 600b923 + f73489e commit 98f1cfd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/AuditingServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;

use OwenIt\Auditing\Contracts\Auditor;
use OwenIt\Auditing\Console\AuditDriverCommand;
use OwenIt\Auditing\Console\InstallCommand;
use OwenIt\Auditing\Contracts\Auditor;

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

$this->publishes([
__DIR__ . '/../database/migrations/audits.stub' => database_path(
sprintf('migrations/%s_create_audits_table.php', date('Y_m_d_His'))
),
], 'migrations');
if (!class_exists('CreateAuditsTable')) {
$this->publishes([
__DIR__ . '/../database/migrations/audits.stub' => database_path(
sprintf('migrations/%s_create_audits_table.php', date('Y_m_d_His'))
),
], 'migrations');
}
}
}

Expand Down

0 comments on commit 98f1cfd

Please sign in to comment.