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.
Laravel is a full-stack framework that offers a lot of artisan commands to automate various actions, like creating a controller, seeding the database, and starting the server. However, when you build custom solutions, you have your own special needs, which could include a new command.
To create a new artisan command, we can use the make:command artisan command. This command will make a new command class within the app/Console/Commands catalog. In case the directory does not exist in our laravel project, it'll be automatically made the primary time we run the artisan make:command command.
Laravel Tinker allows you to interact with a database without creating the routes. Laravel tinker is used with a php artisan to create the objects or modify the data. The php artisan is a command-line interface that is available with a Laravel. Tinker is a command tool that works with a php artisan.
Artisan is the name of the command-line interface included with Laravel. It provides a number of helpful commands for your use while developing your application.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With