PHPackages                             mohammedmanssour/laravel-recurring-models - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mohammedmanssour/laravel-recurring-models

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mohammedmanssour/laravel-recurring-models
=========================================

Adds Repeatable functionlity to Laravel Models

v0.7.1(8mo ago)26924.6k↑89.4%24[9 issues](https://github.com/mohammedmanssour/laravel-recurring-models/issues)[4 PRs](https://github.com/mohammedmanssour/laravel-recurring-models/pulls)MITPHPPHP ^8.1CI failing

Since Apr 24Pushed 8mo ago3 watchersCompare

[ Source](https://github.com/mohammedmanssour/laravel-recurring-models)[ Packagist](https://packagist.org/packages/mohammedmanssour/laravel-recurring-models)[ Docs](https://github.com/mohammedmanssour/laravel-recurring-models)[ RSS](/packages/mohammedmanssour-laravel-recurring-models/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (9)Versions (15)Used By (0)

Laravel Recurring Models
========================

[](#laravel-recurring-models)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0d16134e6bc2d5d2dd0bd01044a7c4577b8e376bdd8ad0e5dc30865d5a8ca92b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f68616d6d65646d616e73736f75722f6c61726176656c2d726563757272696e672d6d6f64656c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mohammedmanssour/laravel-recurring-models)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c5533abc32c35800d2214c0d39c685f80c9e33e1d552747d31f98fefca4e67bc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f68616d6d65646d616e73736f75722f6c61726176656c2d726563757272696e672d6d6f64656c732f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/mohammedmanssour/laravel-recurring-models/actions?query=workflow%3Arun-tests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3d5778c755d04046b837541ca1634aa5adc3af71bbfd4ace60cb7bc14b6a0c30/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f68616d6d65646d616e73736f75722f6c61726176656c2d726563757272696e672d6d6f64656c732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/mohammedmanssour/laravel-recurring-models/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/42c685e972be51c20fccffb2161434b68ad607e77714911c46044371eb6387bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f68616d6d65646d616e73736f75722f6c61726176656c2d726563757272696e672d6d6f64656c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mohammedmanssour/laravel-recurring-models)

Introducing our Laravel Recurring package - the ultimate solution for adding recurring functionality to your Laravel Models! Whether you need simple daily, weekly, or every n days recurrence, or more complex patterns like repeating a model on the second Friday of every month, our package has got you covered. With a seamless integration into your Laravel application, you can easily manage and automate recurring tasks with just a few lines of code.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mohammedmanssour/laravel-recurring-models
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="recurring-models-migrations"
php artisan migrate
```

Usage
-----

[](#usage)

### Adding the recurring functionality to Models:

[](#adding-the-recurring-functionality-to-models)

1. Make sure you models implements `Repeatable` Contract.

```
use MohammedManssour\LaravelRecurringModels\Contracts\Repeatable as RepeatableContract;

class Task extends Model implements RepeatableContract
{

}
```

2. Add the `Repeatable` trait to your Model

```
use MohammedManssour\LaravelRecurringModels\Contracts\Repeatable as RepeatableContract;
use MohammedManssour\LaravelRecurringModels\Concerns\Repeatable;

class Task extends Model implements RepeatableContract
{
    use Repeatable;
}
```

3. Optionaly, customize Model base date.

```
/**
 * define the base date that we would use to calculate repetition start_at
 */
public function repetitionBaseDate(RepetitionType $type = null): Carbon
{
    return $this->created_at;
}
```

### Model Recurring rules

[](#model-recurring-rules)

The `Repeatable` trait has `repeat` method that will help you define the recurrence rules for the model.

The `repeat` method will return `Repeat` helper class that has 4 methods: `daily`, `everyNDays`, `weekly`, and `complex`

#### 1. Daily Recurrence

[](#1-daily-recurrence)

This will help you to create daily recurring rule for the model.

```
$model->repeat()->daily()
```

The recurrence will start the next day based on the `repetitionBaseDate` returned value.

#### 2. Every N Days Recurrence

[](#2-every-n-days-recurrence)

This will help you to create every N Days recurring rules for the model.

```
$model->repeat()->everyNDays(days: 3)
```

The recurrence will start after n=3 days based on the `repetitionBaseDate` returned value.

#### 3. Weekly Recurrence

[](#3-weekly-recurrence)

This will help ypi create weekly recurrence rule for the model.

```
$model->repeat()->weekly()
```

The recurrence will start after 7 days based on the `repetitionBaseDate` returned value.

You can specify the days of the recurrence using the `on` method.

```
$model->repeat()->weekly()->on(['sunday', 'monday', 'tuesday'])
```

#### 4. Complex Recurrence.

[](#4-complex-recurrence)

This will help you create complex recurrence rules for the task.

```
$model->repeat()
    ->complex(
        year: '*',
        month: '*',
        day: '*',
        week: '*',
        weekOfMonth: '*',
        weekday: '*'
    )
```

##### Examples

[](#examples)

1. Repeat model on the second friday of every month.

```
$model->repeat()->complex(weekOfMonth: 2, weekday: Carbon::FRIDAY)
```

2. Repeat model on the 15th day of every month.

```
$model->repeat()->complex(day: 15)
```

### Model Scopes

[](#model-scopes)

use `whereOccurresOn` scope to get models that occurres on a specific date.

```
Task::whereOccurresOn(Carbon::make('2023-05-01'))->get()

```

use `whereOccurresBetween` scope to get the models that occurres between two sepcific dates.

```
Task::whereOccurresBetween(Carbon::make('2023-05-01'), Carbon::make('2023-05-30'))->get()

```

#### 1. End Recurrance

[](#1-end-recurrance)

use `endsAt` to end occurrance on a specific date

```
$model->repeat()->daily()->endsAt(
    Carbon::make('2023-06-01')
)
```

use `endsAfter` to end occurrance after n times.

```
$model->repeat()->daily()->endsAfter($times);
```

#### 2. Start Recurrance

[](#2-start-recurrance)

use `startsAt` method to start occurrance after a specific date.

```
$model->repeat()->daily()->startsAt(
    Carbon::make()
)
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Mohammed Manssour](https://github.com/mohammedmanssour)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance59

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~90 days

Recently: every ~195 days

Total

11

Last Release

264d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aeb75f35979097845cce704062910a6a8c85bc0a7b49b081df7350a4f20023fc?d=identicon)[manssour.mohammed](/maintainers/manssour.mohammed)

---

Top Contributors

[![mohammedmanssour](https://avatars.githubusercontent.com/u/19733629?v=4)](https://github.com/mohammedmanssour "mohammedmanssour (35 commits)")[![EriBloo](https://avatars.githubusercontent.com/u/19932449?v=4)](https://github.com/EriBloo "EriBloo (9 commits)")[![errand](https://avatars.githubusercontent.com/u/1334432?v=4)](https://github.com/errand "errand (1 commits)")[![justrau](https://avatars.githubusercontent.com/u/10882793?v=4)](https://github.com/justrau "justrau (1 commits)")

---

Tags

laravelMohammedManssourlaravel-recurring-models

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mohammedmanssour-laravel-recurring-models/health.svg)

```
[![Health](https://phpackages.com/badges/mohammedmanssour-laravel-recurring-models/health.svg)](https://phpackages.com/packages/mohammedmanssour-laravel-recurring-models)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

124603.0k](/packages/worksome-exchange)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[tarfin-labs/event-machine

Event-driven state machines for Laravel with event sourcing, type-safe context, and full audit trail.

199.4k](/packages/tarfin-labs-event-machine)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k3](/packages/tapp-filament-form-builder)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
