shinyMao shinyMao - 3 months ago 10
PHP Question

Laravel: the time for job queue

With Laravel, I would like to make a job queue each 3 months ! So I would like to check.

$schedule->command('emails:send')->monthly()->monthly()->monthly()->when(function () {
return true;
});


Can I write like above?

Answer

Using monthly() three time won't work.

You will have to use crontab syntax to make a job run 'every three month'

Something like:

$schedule->command('emails:send')->cron('* * * */3');

Double check the crontab entry with online tools such as cronmaker.