From 8fa5c8601e8492758b2288093217543a0215ff3e Mon Sep 17 00:00:00 2001 From: Alexander Karlstad Date: Wed, 4 Nov 2020 15:53:56 +0100 Subject: [PATCH] Move dispatching of event to before seeders are run (#35091) --- .../Database/Console/Migrations/FreshCommand.php | 8 ++++---- .../Database/Console/Migrations/RefreshCommand.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Illuminate/Database/Console/Migrations/FreshCommand.php b/src/Illuminate/Database/Console/Migrations/FreshCommand.php index bfff28ce3c8e..7bfba0d78821 100644 --- a/src/Illuminate/Database/Console/Migrations/FreshCommand.php +++ b/src/Illuminate/Database/Console/Migrations/FreshCommand.php @@ -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; } diff --git a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php b/src/Illuminate/Database/Console/Migrations/RefreshCommand.php index 75e163a36fdb..2073cd9977e6 100755 --- a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php +++ b/src/Illuminate/Database/Console/Migrations/RefreshCommand.php @@ -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; }