Get started with 33% off your first certification using code: 33OFFNEW

A guide to all available scheduling schedules in Laravel

3 min read
Published on 1st February 2024

Laravel's task scheduling is a powerful feature that simplifies the management of periodic tasks such as sending out emails, cleaning up databases, or generating reports. Instead of creating a Cron job for each task, Laravel allows you to define your schedule within your application, providing a more readable and maintainable approach. This article provides an overview of all available scheduling schedules in Laravel.

Basics of Laravel Scheduling

Laravel's scheduler is defined in the app/Console/Kernel.php file. The scheduler offers a fluent API to expressively define the frequency of commands and tasks. To enable it, a single Cron entry on your server is required, which executes the Laravel scheduler every minute:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Available Scheduling Frequencies

Laravel offers a variety of scheduling frequencies, allowing for granular control over task execution. Here are the most commonly used options:

1. ->everyMinute();

The task will run every minute:


2. ->everyTwoMinutes();

To run a task every two minutes:


3. ->everyFiveMinutes();

For tasks that should occur every five minutes:


4. ->everyTenMinutes();

To schedule a task every ten minutes:


5. ->everyFifteenMinutes();

To run a task every fifteen minutes:


6. ->everyThirtyMinutes();

For tasks that should run every thirty minutes:


7. ->hourly();

To run a task at the beginning of every hour:


8. ->hourlyAt(17);

Run a task at a specific minute past the hour:


9. ->daily();

For tasks that should run once a day:


10. ->dailyAt('13:00');

To run a task every day at a specific time:


11. ->twiceDaily(1, 13);

To run a task twice a day at specific times:

$schedule->command('report:generate')->twiceDaily(1, 13);

12. ->weekly();

For tasks that should run once a week:


13. ->weeklyOn(1, '8:00');

Run a task on a specific day and time of the week (0 = Sunday, 1 = Monday, etc.):

$schedule->command('report:weekly')->weeklyOn(1, '8:00');

14. ->monthly();

To run a task once a month:


15. ->monthlyOn(4, '15:00');

Run a task on a specific day of the month at a specific time:

$schedule->command('subscription:renew')->monthlyOn(4, '15:00');

16. ->quarterly();

For tasks that should run every quarter:


17. ->yearly();

To run a task once a year:


18. ->weekdays();

Run a task every weekday:


19. ->weekends();

For tasks to run on weekends:


Combining Constraints

You can combine multiple time constraints for a single task:


Laravel's scheduling system provides a robust and fluent way to manage timed tasks in your application. With a wide range of scheduling options, you can tailor tasks to run precisely when needed, keeping your application efficient and responsive. By learning these scheduling capabilities, you can ensure your Laravel application performs optimally with minimal manual intervention.