"There are no commands defined in the 'command' namespace." after running command:make in Laravel

Zbigniew Kisły picture Zbigniew Kisły · Sep 4, 2015 · Viewed 44k times · Source

Just like in title. I'm trying to run from artisan

php artisan command:make NameOfCommand

but all I see is

There are no commands defined in the "command" namespace.

Any idea what is this?

Answer

Alejandro Silva picture Alejandro Silva · May 20, 2016

As the documentation says (Current version is 5.2 at this moment):

Once your command is finished, you need to register it with Artisan so it will be available for use. This is done within the app/Console/Kernel.php file.

in the Kernel.php file you must add: protected $commands = [ Commands\NameOfCommand::class ];

(ref: https://laravel.com/docs/5.2/artisan#registering-commands)