Skip to content

Commit

Permalink
Ensure we don't autoload commands until the app is booted
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Oct 1, 2024
1 parent 5e637d7 commit 81d3d7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Providers/AddonServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 81d3d7b

Please sign in to comment.