Create Repeatable Models with Laravel Recurring Models


May 9th, 2023

Create Repeatable Models with Laravel Recurring Models

Sometimes you need data to repeat on a date interval, like a standing calendar appointment, a weekly event, or a payment schedule. The Recurring Models package for Laravel is the ultimate solution for adding recurring functionality to your Laravel Models:

->on(['sunday', 'monday', 'tuesday']);

When you repeat a model, the start date is calculated using a startsAt() method on the model. Or you can specify the start date as follows:


You can also set an end date when the recurring model should stop:


And once you have recurring data, you can retrieve it using the package's provided scopes:

$tasks = Task::whereOccurresOn(
// Between
$tasks = Task::whereOccurresBetween(

This new package could serve as an excellent inspiration for simplifying models that need repeating with dates. To get started with this package, check out the source code. on GitHub.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.