10 months ago

Running Console Command from Subfolder

Posted 10 months ago by timgavin

I created a command in a subfolder...

php artisan make:command MyCommands/CommandOne

And I edited it...


namespace App\Console\Commands\MyCommands;

use Illuminate\Console\Command;

class CommandOne extends Command
    protected $signature = 'my:command';

    protected $description = 'Testing it out';

    public function __construct()

    public function handle()
        $this->info('It works!');

I then ran it...


and got an error:

bash: my:command: command not found

How do I run a command in a sub-folder?

Please sign in or create an account to participate in this conversation.