Answer the question
In order to leave comments, you need to log in
How to run a cron job in Laravel?
Hello!
There is a command
$schedule->command('service:priceup')->cron('45 10 * * *');
In theory, it should start at 10:45, but for some reason it doesn’t work, what could be the reason? Call from the console, the command works correctly.
The problem was in calling additional methods in the routing, namely for dev Artisan::call('view:clear');
Removed everything worked.
Answer the question
In order to leave comments, you need to log in
Did you do everything according to the instructions ?
When using the scheduler, you only need to add the following Cron entry to your server:
This Cron will call the Laravel command scheduler every minute. When the schedule:run command is executed, Laravel will evaluate your scheduled tasks and runs the tasks that are due.
$schedule->command('stocks:cron')->cron("*/15 * * * *"); every 15 minutes
According to the schedule, you can see here
https://en.wikipedia.org/wiki/Cron
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question