Register the command.

@param string $command
@return void
482987
protected function registerDatabaseRollbackCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Database\Commands\DatabaseRollbackCommand($app);
        });
    }
1232751
final public function handle(Command $command): void
    {
        if (!$command instanceof ReceivedCommand && $this->discriminator->shouldEnqueue($command)) {
            $this->queue->send($command);

            return;
        }

        if ($command instanceof ReceivedCommand) {
            $command = $command->getOriginalCommand();
        }

        $this->wrappedCommandBus->handle($command);
    }
560644
protected function dispatch(string $command): void
    {
        $console = $this->testbench->artisan($command, $this->options);

        if ($console instanceof PendingCommand) {
            $console->run();
        }
    }
285224
private function call($command)
    {
        if (!in_array($command, static::COMMAND)) {
            $this->throwFailsCommand("The command '$command' not exists.", 'help');
        }

        if (!$this->arg->getParameter('action')) {
            if ($this->arg->getParameter('target') == 'help') {
                $this->help($command);

                exit(0);
            }
        }

        try {
            call_user_func_array(
                [$this, $command],
                [$this->arg->getParameter('target')]
            );
        } catch (\Exception $e) {
            echo $e->getMessage();

            exit(1);
        }
    }
1123765
protected function registerMakePolicyCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\PolicyMakeCommand($app);
        });
    }
651690
public function runCommand($command)
    {
        $this->setAutoExit(false);
        $argv = explode(' ','application '.$command);
        $input = new ArgvInput($argv);
        $this->run($input);
    }
1152677
private function registerCommand($class, $command)
    {
        $this->app->singleton($this->commandPath . $command, function ($app) use ($class) {
            return $app[$class];
        });

        $this->commands($this->commandPath . $command);
    }
1130097
public function addCommand($command)
    {
        if (is_string($command)) {
            $command = $this->app->make($command);
        }

        if ($command instanceof Command) {
            $command->setLaravel($this->app);
        }

        $this->console->add($command);
    }
410218
public function fire(Command $command)
    {
        $this->command = $command;

        if ($command->option('verbose')) {
            $command->blockMessage('Requirements', 'Checking System Requirements ...', 'comment');
        }

        $this->checkPHPVersion();
        $this->checkExtensions();

        $this->showResults();
    }
1040633
protected function registerMakeEventCommand($command)
     {
         $this->app->singleton($command, function ($app) {
             return new Generators\Commands\EventMakeCommand($app);
         });
     }
1186403
protected function registerRegisterUserCommand()
    {
        $this->app->singleton('command.authentication.user.register', function ($app) {
            return $app->make(RegisterUser::class);
        });
        $this->commands('command.authentication.user.register');
    }
1276973
public function handle(RegisterMessageCommand $command)
    {
        $message = $this->desc->registerMessage($command->type_name, $command->data_arr);

        //Потом переписать под генерацию событий самим desc объектом
        //и подписку на события
        //а пока:

        $block = $this->queryAgent->getBlock('fidback',[],[]);

        //------------------
        try{
            $inqueue  = $block->inqueue_field;
            if(!$inqueue)
            {
                $inqueue = config('fidback')['inqueue'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $inqueue = config('fidback')['inqueue'];
        }
        //------------------

        try{
            $mailto  = $block->mail_rec_field;
            if(!$mailto)
            {
                $mailto = config('fidback')['mail_rec'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $mailto = config('fidback')['mail_rec'];
        }
        //------------------
        try{
            $mailto_copy1  = $block->mail_rec_copy1_field;
            if(!$mailto_copy1)
            {
                $mailto_copy1 = config('fidback')['mail_rec_copy1'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $mailto_copy1 = config('fidback')['mail_rec_copy1'];
        }
        //------------------
        try{
            $mailto_copy2  = $block->mail_rec_copy2_field;
            if(!$mailto_copy2)
            {
                $mailto_copy2 = config('fidback')['mail_rec_copy2'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $mailto_copy2 = config('fidback')['mail_rec_copy2'];
        }
        //------------------
        try{
            $mailto_copy3  = $block->mail_rec_copy3_field;
            if(!$mailto_copy3)
            {
                $mailto_copy3 = config('fidback')['mail_rec_copy3'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $mailto_copy3 = config('fidback')['mail_rec_copy3'];
        }
        //------------------

        try{
            $username  = $block->mail_username_field;
            if(!$username)
            {
                $username = config('fidback')['mail_username'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $username = config('fidback')['mail_username'];
        }
        //------------------
        try{
            $site_name  = $block->site_name_field;
            if(!$site_name)
            {
                $site_name = config('fidback')['site_name'];
            }
        }catch(WrongBlockFieldNameException $exc){
            $site_name = config('fidback')['site_name'];
        }
        //------------------

        try
        {
            $message_id = $message->id_field;

            if($inqueue)
            {
                Mail::queue('back/mail/'.$command->template,
                    ['item'=>$message],
                    function($message) use ($username, $mailto, $mailto_copy1, $mailto_copy2, $mailto_copy3, $site_name, $message_id)
                    {
                        $message->from($username, $site_name);
                        $message->to($mailto);
                        if($mailto_copy1){
                            $message->cc($mailto_copy1);
                        }
                        if($mailto_copy2){
                            $message->cc($mailto_copy2);
                        }
                        if($mailto_copy3){
                            $message->cc($mailto_copy3);
                        }
                        $message->subject('Сообщение из сайта '.$site_name);

                        Bus::dispatch(new UpdateGroupItemCommand($message_id, ['bools'=>['mailed'=>true]]));

                    },'mailqueue');
            }else{
                Mail::send('back/mail/'.$command->template,
                    ['item'=>$message],
                    function($message) use ($username, $mailto, $mailto_copy1, $mailto_copy2, $mailto_copy3, $site_name, $message_id)
                    {
                        $message->from($username, $site_name);
                        $message->to($mailto);
                        if($mailto_copy1){
                            $message->cc($mailto_copy1);
                        }
                        if($mailto_copy2){
                            $message->cc($mailto_copy2);
                        }
                        if($mailto_copy3){
                            $message->cc($mailto_copy3);
                        }
                        $message->subject('Сообщение из сайта '.$site_name);

                        Bus::dispatch(new UpdateGroupItemCommand($message_id, ['bools'=>['mailed'=>true]]));

                    });
            }
        }catch(\Exception $Exc)
        {
            Log::info($Exc->getMessage());
        }

    }
180548
public function addCustomCommand($command)
    {
        $name = lcfirst(class_basename($command));

        $this->customCommands[$name] = $command;
    }
700671
public function unregisterCommand($command)
    {
        if (! array_key_exists($command, $this->commands)) {
            throw new \Exception("A command with the name {$command} does not exist.");
        }

        unset($this->commands[$command]);
    }
50084
protected function registerMakeSeederCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Database\Commands\SeederMakeCommand($app);
        });
    }
702697
protected function registerCommands(array $commands)
	{
		if (!$this->app->runningInConsole()) {
			return;
		}

		foreach ($commands as $key => $command) {
			if (is_numeric($key)) {
				$key = Str::lower(str_replace("\\", '.', $command));
			}

			$method = "register{$command}";

			try {
				if (method_exists($this, $method)) {
					call_user_func_array([$this, $method], [$key]);
				} else {
					$this->app->singleton($key, function ($app) use ($command) {
						return $app->make($command);
					});
				}
				$this->commands($key);
			} catch (\Exception $e) {
				throw $e;
			}
		}
	}
1295064
public function command($command)
    {
        if (! $command instanceof Command) {
            $command = $this[$command];
        }

        $this['console']->add($command);
    }