yosifeldman's avatar

Artisan console runs only the 1st custom command

Hi everyone.

When adding my custom commands on the list inside the app/Console/Kernel.php, like this:

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        Commands\MyCommandOne::class,
        Commands\MyCommandTwo::class,
        Commands\MyCommandThree::class,
    ];
.......

And then creating new classes to handle each command:

class MyCommandOne extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'my:command:one';
........

The result is - whatever I'm trying to run with the php artisan whatever:whatever is always running the 1st command on the list (MyCommandOne). Even built in commands like php artisan list are running just my 1st command MyCommandOne...

Looks like a system bug. Did anyone encounter & fixed this?

Thanks all in advance.

0 likes
0 replies

Please or to participate in this conversation.