From 728d14563ed3ed923651983ac410aad688102646 Mon Sep 17 00:00:00 2001 From: Andy Heathershaw Date: Sun, 28 Jul 2019 12:51:12 +0100 Subject: [PATCH] Do a comparison for Laravel 5.5 when auto-discovering commands --- app/Console/Kernel.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index be5a572..214645a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -6,6 +6,7 @@ use App\Console\Commands\ProcessUploadCommand; use App\Console\Commands\RegenerateThumbnailsCommand; use App\Upload; use Illuminate\Console\Scheduling\Schedule; +use Illuminate\Foundation\Application; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel @@ -36,6 +37,11 @@ class Kernel extends ConsoleKernel protected function commands() { require base_path('routes/console.php'); - $this->load(__DIR__.'/Commands'); + + // We can only auto-load commands for Laravel 5.5.0 or above + if (version_compare(Application::VERSION, '5.5.0') >= 0) + { + $this->load(__DIR__.'/Commands'); + } } }