From 81d3d7ba8a42640e6a0f0f50f42731e7bf1609a9 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Tue, 1 Oct 2024 10:05:40 +0100 Subject: [PATCH] Ensure we don't autoload commands until the app is booted --- src/Providers/AddonServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Providers/AddonServiceProvider.php b/src/Providers/AddonServiceProvider.php index f1a78c7717..4f6f96102e 100644 --- a/src/Providers/AddonServiceProvider.php +++ b/src/Providers/AddonServiceProvider.php @@ -345,7 +345,7 @@ protected function bootPolicies() protected function bootCommands() { - if ($this->app->runningInConsole()) { + if ($this->app->isBooted() && $this->app->runningInConsole()) { $commands = collect($this->commands) ->merge($this->autoloadFilesFromFolder('Commands', Command::class)) ->merge($this->autoloadFilesFromFolder('Console/Commands', Command::class))