Answer the question
In order to leave comments, you need to log in
How to set up cron in laravel?
Good afternoon!
I read the official documentation, but to be honest, I did not understand these things.
1) Is it necessary to specify the task only in this file: App\Console\Kernel.php? Or is it possible in any other?
2) It is written that you can somehow configure it through php artisan, but the command is not given
3) Sheduler - has something in common with cron? Or is it a completely separate option that will work even on LAN? Or does it connect to the crown and work like that?
4) There is quite a long code (about 200 lines) aimed at constantly adding / updating information in the database. To run every minute. Where is the best place to put this code? Is it possible to create a separate file for it? In general, the question is similar to the first.
Thanks to!
Answer the question
In order to leave comments, you need to log in
https://laravel.com/docs/5.4/scheduling
is chewed up though.
1. run there
2. not through, but you can run any command by cron.
3. this is the scheduler, and this is the cron. works with the help of cron, Laravel's schedule is controlled by laravel, cron kicks laravel every minute.
4. create a command, a class, anything, but definitely not put it in the kernel, there is only a launch.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question