diff --git a/src/Illuminate/Console/Application.php b/src/Illuminate/Console/Application.php index add753d16022..aa3ac182f299 100755 --- a/src/Illuminate/Console/Application.php +++ b/src/Illuminate/Console/Application.php @@ -16,6 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Application as SymfonyApplication; use Symfony\Component\Console\Command\Command as SymfonyCommand; +use Symfony\Component\Console\Exception\CommandNotFoundException; use Illuminate\Contracts\Console\Application as ApplicationContract; class Application extends SymfonyApplication implements ApplicationContract @@ -172,6 +173,10 @@ public function call($command, array $parameters = [], $outputBuffer = null) $command = $this->laravel->make($command)->getName(); } + if (! $this->has($command)) { + throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $command)); + } + array_unshift($parameters, $command); $this->lastOutput = $outputBuffer ?: new BufferedOutput;