Quantcast
Channel: Laravel News
Viewing all articles
Browse latest Browse all 1870

Laravel Scheduler Adds Support for Running Hourly Tasks on a Certain Minute

$
0
0

The Laravel Scheduler now includes a new method hourlyAt that will allow you to define the minute within the hour that it should run. This helpful in situations where you have a task that should run hourly but not at the top of the hour.

Using the same simple syntax as all the other methods and here is a quick example:

$schedule->command('mytask')->hourlyAt(15);

This will set the command to run every hour on the 15th minute. Of course, you can still pair it with the other methods to get more fine-grained control:

$schedule->command('mytask')
    ->weekdays()
    ->hourlyAt(15);

This feature is included starting at v5.3.29 and will allow you to use the familiar syntax instead of having to jump into using the cron method to define it.


Viewing all articles
Browse latest Browse all 1870

Latest Images

Trending Articles



Latest Images