/** * Register the package's custom Artisan commands. * * @param array|mixed $commands * @return void */ public function commands($commands) { $commands = is_array($commands) ? $commands : func_get_args(); Artisan::starting(function ($artisan) use($commands) { $artisan->resolveCommands($commands); }); }
/** * Register a Closure based command with the application. * * @param string $signature * @param Closure $callback * @return \Illuminate\Foundation\Console\ClosureCommand */ public function command($signature, Closure $callback) { $command = new ClosureCommand($signature, $callback); Artisan::starting(function ($artisan) use($command) { $artisan->add($command); }); return $command; }