Have you seen our video tutorials? Check 'em out!

Can't make our own artisan commands??

emergingdzns - 1 month ago

I need to add my own artisan command. I tried using php artisan make:command mycommandname but I can’t get it to register in the system. I tried adding it to the protected $commands list in the Kernel.php file. I tried just adding the whole command to the routes/console.php file as well. But nothing I do seems to work. There’s one command in the the routes/console.php file called “inspire” but when I try to run it at command line it errors as does my own command. Any ideas? What's the special magic required to add our own commands?

Answer

ryanthompson - 1 month ago

You sure can! However check out this video: http://pyrocms.com/videos/series/module-development/the-anatomy-of-a-module

The kernels are not used but they are left in by default.

Instead you can define commands (among other things) in your addon's ServiceProvider or in config/streams.php.

ryanthompson - 1 month ago

You sure can! However check out this video: http://pyrocms.com/videos/series/module-development/the-anatomy-of-a-module

The kernels are not used but they are left in by default.

Instead you can define commands (among other things) in your addon's ServiceProvider or in config/streams.php.