Example #1
0
 /**
  * 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);
     });
 }
Example #2
0
 /**
  * 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;
 }