Skip to content

Commit

Permalink
Move dispatching of event to before seeders are run (#35091)
Browse files Browse the repository at this point in the history
  • Loading branch information
carestad authored Nov 4, 2020
1 parent c34aa28 commit 8fa5c86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Illuminate/Database/Console/Migrations/FreshCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ public function handle()
'--step' => $this->option('step'),
]));

if ($this->needsSeeding()) {
$this->runSeeder($database);
}

if ($this->laravel->bound(Dispatcher::class)) {
$this->laravel[Dispatcher::class]->dispatch(
new DatabaseRefreshed
);
}

if ($this->needsSeeding()) {
$this->runSeeder($database);
}

return 0;
}

Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Database/Console/Migrations/RefreshCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ public function handle()
'--force' => true,
]));

if ($this->needsSeeding()) {
$this->runSeeder($database);
}

if ($this->laravel->bound(Dispatcher::class)) {
$this->laravel[Dispatcher::class]->dispatch(
new DatabaseRefreshed
);
}

if ($this->needsSeeding()) {
$this->runSeeder($database);
}

return 0;
}

Expand Down

0 comments on commit 8fa5c86

Please sign in to comment.