Register the command.

@param string $command
@return void
776026
protected function registerMakeMiddlewareCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\MiddlewareMakeCommand($app);
        });
    }
766367
protected function registerCommands(): void
    {
        // Register artisan commands
        foreach ($this->commands as $key => $value) {
            $this->app->singleton($value, $key);
        }

        $this->commands(array_values($this->commands));
    }
317922
public function register()
    {
        foreach ($this->commands as $binding => $command) {
            $bind    = $this->prefix . $binding;
            $command = '\\' . $this->namespace . '\\' . $command . $this->commandSuffix;
            unset($this->commands[ $binding ]);
            $this->commands[ $bind ] = $command;
            $this->app->singleton($bind, $command);
        }

        $this->commands(array_keys($this->commands));
    }
349768
public function add_command($command)
    {
        if (is_string($command)) {
            $command = (new \ReflectionClass($command))->newInstance(self::$CI);
        }

        if (!$command instanceof Commands) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Argument 1 passed to %s must be an instance of %s, %s given',
                    __NAMESPACE__ . '\Cli::add_command()',
                    __NAMESPACE__ . '\Commands',
                    gettype($command)
                )
            );
        }

        $this->commands[$command->name()] = $command;
    }
152955
protected function addConsoleCommand(Command $command)
    {
        Deprecated::method(3.0, 'registerNutCommands');

        $app = $this->getContainer();
        $app['nut.commands.add']($command);
    }
457978
protected function registerAddonRemoveCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Addons\Commands\AddonRemoveCommand($app);
        });
    }
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);
    }
125996
protected function registerMakeListenerCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\ListenerMakeCommand($app);
        });
    }
1215145
protected function registerAddonNameCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Addons\Commands\AddonNameCommand($app);
        });
    }
553005
protected function registerCommands()
    {
        ensure_trait_used_in_subclass_of_or_fail(self::class, $this, ServiceProvider::class);

        foreach (array_keys($this->commands) as $command) {
            $method = "register{$command}Command";
            call_user_func_array([$this, $method], []);
        }
        $this->commands(array_values($this->commands));
    }
744606
protected function registerAdminCommand()
    {
        $this->app->singleton('command.authentication.user.admin', function ($app) {
            return $app->make(Admin::class);
        });
        $this->commands('command.authentication.user.admin');
    }
1169859
public static function register($command, $callback)
    {
        if (!is_string($command) || strlen($command) < 1) {
            throw new BadMethodCallException('Parameter command is not a valid string');
        }
        if (!is_callable($callback)) {
            throw new BadMethodCallException('Parameter callback is not a valid callback');
        }

        $instance = self::getInstance();
        
        $instance->commands[$command] = $callback;
        
        return $instance;
    }
1186403
protected function registerRegisterUserCommand()
    {
        $this->app->singleton('command.authentication.user.register', function ($app) {
            return $app->make(RegisterUser::class);
        });
        $this->commands('command.authentication.user.register');
    }
506576
protected function registerMakeModelCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Generators\Commands\ModelMakeCommand($app);
        });
    }
856381
protected function registerCommands(array $commands)
    {
        foreach ($commands as $command) {
            if ( ! $command instanceof SymfonyCommand) {
                $command = $this->container[$command];
            }

            $this->container['console']->add($command);
        }
    }
350215
protected function setCommand($command)
    {
        $this->command = $command;

        if (!is_null($this->loader)) {
            $this->loader->setCommand($this->command);
        }
    }
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;
			}
		}
	}