diff --git a/src/Illuminate/Database/Console/Migrations/FreshCommand.php b/src/Illuminate/Database/Console/Migrations/FreshCommand.php index 50dfe2bf8a92..bfff28ce3c8e 100644 --- a/src/Illuminate/Database/Console/Migrations/FreshCommand.php +++ b/src/Illuminate/Database/Console/Migrations/FreshCommand.php @@ -59,9 +59,11 @@ public function handle() $this->runSeeder($database); } - $this->laravel[Dispatcher::class]->dispatch( - new DatabaseRefreshed() - ); + if ($this->laravel->bound(Dispatcher::class)) { + $this->laravel[Dispatcher::class]->dispatch( + new DatabaseRefreshed + ); + } return 0; } diff --git a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php b/src/Illuminate/Database/Console/Migrations/RefreshCommand.php index 328ccee23007..75e163a36fdb 100755 --- a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php +++ b/src/Illuminate/Database/Console/Migrations/RefreshCommand.php @@ -69,9 +69,11 @@ public function handle() $this->runSeeder($database); } - $this->laravel[Dispatcher::class]->dispatch( - new DatabaseRefreshed() - ); + if ($this->laravel->bound(Dispatcher::class)) { + $this->laravel[Dispatcher::class]->dispatch( + new DatabaseRefreshed + ); + } return 0; }