Skip to content

Commit

Permalink
check if the command being auto registered is subclass of illuminate…
Browse files Browse the repository at this point in the history
… console command
  • Loading branch information
themsaid committed Jul 17, 2017
1 parent e878807 commit d607b9c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Illuminate/Foundation/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
});
}
}
}

Expand Down

0 comments on commit d607b9c

Please sign in to comment.