From d607b9c670d9c7f7c749cda0a12a1dc6f55da6e4 Mon Sep 17 00:00:00 2001 From: Mohamed Said Date: Mon, 17 Jul 2017 16:27:23 +0200 Subject: [PATCH] check if the command being auto registered is subclass of illuminate console command --- src/Illuminate/Foundation/Console/Kernel.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Foundation/Console/Kernel.php b/src/Illuminate/Foundation/Console/Kernel.php index c99d53ee3211..b95deb0f0c57 100644 --- a/src/Illuminate/Foundation/Console/Kernel.php +++ b/src/Illuminate/Foundation/Console/Kernel.php @@ -6,6 +6,7 @@ use Exception; use Throwable; use Illuminate\Support\Str; +use Illuminate\Console\Command; use Symfony\Component\Finder\Finder; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Contracts\Events\Dispatcher; @@ -211,9 +212,11 @@ protected function load($path) Str::after($command->getPathname(), app_path().'/') ); - Artisan::starting(function ($artisan) use ($command) { - $artisan->resolve($command); - }); + if (is_subclass_of($command, Command::class)) { + Artisan::starting(function ($artisan) use ($command) { + $artisan->resolve($command); + }); + } } }