- $this->commands[] = $command;
- }
-
- /**
- * Get the custom commands that have been registered.
- */
- public function getRegisteredCommands(): array
- {
- return $this->commands;
+ Artisan::starting(function (Application $application) use ($command) {
+ $application->addCommands([$command]);
+ });