Lumen make:command
Lumen make:command
I'm trying to execute code within my Lumen install via the command line. In full Laravel , I've read that you can use commands to achieve this via "make:command", but Lumen does not seem to support this command.
Is there anyway to enable this command? Failing that, what's the best way of running code from the CLI in Lumen?
Thanks
2 Answers
2
You can use the artisan CLI in Lumen as the same way as in Laravel but with fewer built-in commands. To see all built-in commands, use the php artisan command in Lumen.
artisan
php artisan
Although there is no make:command command at Lumen, you can create your custom command:
make:command
Add new command class inside the app/Console/Commands folder, you can use the sample class template of the framework serve command
app/Console/Commands
serve
Register your custom command by adding your created class to the $commands member inside the app/Console/Kernel.php file.
$commands
app/Console/Kernel.php
Except the command generating, you can use the Laravel docs for commands when working with Lumen.
When you create your command class use this:
<?php namespace AppConsoleCommands;
use IlluminateConsoleCommand;
<?php namespace AppConsoleCommands;
use IlluminateConsoleCommand;
Instead of what was described above about using serve command example
serve command
Please write the solution, links can break.
– Mr Mush
Nov 23 '15 at 12:01
@MrMush Thanks, I updated my answer
– Muhammad
Nov 24 '15 at 13:09
As predicted, broken link
– darryn.ten
Jun 28 at 16:11
I removed the broken link and kept the solution
– Muhammad
Jun 30 at 6:28
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Lumen does not have builtin Commands support
– user1016265
Mar 1 '16 at 14:10