diff --git a/extend/catcher/CatchAdminService.php b/extend/catcher/CatchAdminService.php index edef1c5..6f40ca0 100644 --- a/extend/catcher/CatchAdminService.php +++ b/extend/catcher/CatchAdminService.php @@ -62,7 +62,11 @@ class CatchAdminService extends Service */ protected function registerCommands(): void { - $this->commands((new CatchConsole($this->app))->commands()); + $catchConsole = new CatchConsole($this->app); + + $this->app->bind('catch_console', $catchConsole); + + $this->commands($catchConsole->commands()); } /** * diff --git a/extend/catcher/ModuleService.php b/extend/catcher/ModuleService.php index 840931d..e9f9149 100644 --- a/extend/catcher/ModuleService.php +++ b/extend/catcher/ModuleService.php @@ -55,10 +55,11 @@ abstract class ModuleService extends Service if (method_exists($this,'loadCommands')) { list($namespace, $path) = $this->loadCommands(); - $this->commands((new CatchConsole($this->app)) - ->setNamespace($namespace) - ->path($path) - ->commands()); + $catchConsole = $this->app['catch_console']; + + $this->commands($catchConsole->setNamespace($namespace) + ->path($path) + ->commands()); } }