7

I made a new command with:

php artisan make:console CrawlData

Then I changed two variables:

protected $signature = 'make:crawl';
protected $description = 'My crawling command';

The problem is that when I run:

php artisan make:crawl

It outputs:

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "make:crawl" is not defined.

1 Answer 1

22

You also need to register the command in the App\Console\Kernel class for it to be recognized:

protected $commands = [
    ...
    \App\Console\Commands\CrawlData::class,
];

You can read more about that in the Registering Commands documentation.


Starting with Laravel 5.5 commands in app/Console/Commands are automatically registered.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.