diff --git a/modules/system/classes/PluginBase.php b/modules/system/classes/PluginBase.php index f21e99daa..aa43ab95f 100644 --- a/modules/system/classes/PluginBase.php +++ b/modules/system/classes/PluginBase.php @@ -279,17 +279,13 @@ class PluginBase extends ServiceProviderBase * Registers a new console (artisan) command * * @param string $key The command name - * @param string $class The command class + * @param string|\Closure $command The command class or closure * @return void */ - public function registerConsoleCommand($key, $class) + public function registerConsoleCommand($key, $command) { $key = 'command.'.$key; - - $this->app->singleton($key, function ($app) use ($class) { - return new $class; - }); - + $this->app->singleton($key, $command); $this->commands($key); }