Laravel user command not working

I made a new team using

php artisan make:console CrawlData 

Then I changed two variables:

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

The problem is that on startup:

 php artisan make:crawl 

It outputs:

 [Symfony\Component\Console\Exception\CommandNotFoundException] Command "make:crawl" is not defined. 
+5
source share
1 answer

You also need to register the command in the App\Console\Kernel class to recognize it:

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

You can learn more about this in the documentation Team Registration .

+12
source

Source: https://habr.com/ru/post/1244691/


All Articles