{"id":"27ef1a602efd57d6","repo":"laravel/framework","slug":"the-command-s-does-not-exist","errorCode":null,"errorMessage":"The command \"%s\" does not exist.","messagePattern":"The command \"(.+?)\" does not exist\\.","errorType":"exception","errorClass":"CommandNotFoundException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Console/Application.php","lineNumber":162,"sourceCode":"        static::$bootstrappers = [];\n    }\n\n    /**\n     * Run an Artisan console command by name.\n     *\n     * @param  \\Symfony\\Component\\Console\\Command\\Command|string  $command\n     * @param  array  $parameters\n     * @param  \\Symfony\\Component\\Console\\Output\\OutputInterface|null  $outputBuffer\n     * @return int\n     *\n     * @throws \\Symfony\\Component\\Console\\Exception\\CommandNotFoundException\n     */\n    public function call($command, array $parameters = [], $outputBuffer = null)\n    {\n        [$command, $input] = $this->parseCommand($command, $parameters);\n\n        if (! $this->has($command)) {\n            throw new CommandNotFoundException(sprintf('The command \"%s\" does not exist.', $command));\n        }\n\n        return $this->run(\n            $input, $this->lastOutput = $outputBuffer ?: new BufferedOutput\n        );\n    }\n\n    /**\n     * Parse the incoming Artisan command and its input.\n     *\n     * @param  \\Symfony\\Component\\Console\\Command\\Command|string  $command\n     * @param  array  $parameters\n     * @return array<string, \\Symfony\\Component\\Console\\Input\\ArrayInput>\n     */\n    protected function parseCommand($command, $parameters)\n    {\n        if (is_subclass_of($command, SymfonyCommand::class)) {\n            $callingClass = true;","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Console/Application.php#L144-L180","documentation":"Thrown by Application::call() (src/Illuminate/Console/Application.php:162) — the Artisan call() helper — when the resolved command name is not registered with the console application. Symfony's CommandNotFoundException is thrown after $this->has($command) returns false.","triggerScenarios":"Calling Artisan::call('foo:bar') where foo:bar is not a registered command; passing a typo'd command name; calling a command that lives in a service provider that hasn't been loaded (e.g. deferred provider, or env APP_ENV mismatch); calling a command by class FQN that isn't registered via commands() or Kernel.","commonSituations":"Running tests that invoke Artisan::call() without first registering the command (missing $this->commands[] in a test kernel), typos in command signatures, package commands not registered because the package's ServiceProvider wasn't added to config/app.php.","solutions":["Verify the command is registered: run php artisan list and grep for the name.","Register the command class in your Kernel or service provider's commands() array.","Check for typos and the exact name returned by getName()/the $signature property.","If testing, ensure Artisan::call runs after the kernel boots the command, or use $this->artisan('name') in tests.","If using a package, ensure its ServiceProvider is in config/app.php providers list."],"exampleFix":"// before\nArtisan::call('reports:send-daily');  // not registered\n\n// after\n// in app/Console/Kernel.php -> protected $commands = [\\App\\Console\\Commands\\SendDailyReports::class];\nArtisan::call('reports:send-daily');","handlingStrategy":"validation","validationCode":"$name = 'reports:send';\nif (! \\Illuminate\\Support\\Facades\\Artisan::has($name)) {\n    // register or guard before calling\n}","typeGuard":"function commandRegistered(\\Illuminate\\Console\\Application $app, string $name): bool\n{\n    return $app->has($name);\n}","tryCatchPattern":"use Symfony\\Component\\Console\\Exception\\CommandNotFoundException;\ntry {\n    \\Illuminate\\Support\\Facades\\Artisan::call('reports:send');\n} catch (CommandNotFoundException $e) {\n    // register/typo fallback\n}","preventionTips":["Register commands in Kernel::$commands or via commands().","Use Artisan::has($name) before programmatic invocation.","Run php artisan list to verify exact command names."],"tags":["console","artisan","command-not-found","laravel"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}