PHPackages                             wilianx7/php-recurring - 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. wilianx7/php-recurring

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

wilianx7/php-recurring
======================

PHP library for generating recurring dates, schedules, and repeated task recurrences.

3.0.1(1mo ago)1050.7k—6.2%3MITPHPPHP ^8.3|^8.4CI passing

Since Dec 31Pushed 1mo ago2 watchersCompare

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

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

PHP Recurring
=============

[](#php-recurring)

[![CI](https://github.com/wilianx7/php-recurring/actions/workflows/ci.yml/badge.svg)](https://github.com/wilianx7/php-recurring/actions/workflows/ci.yml)

PHP library for generating recurring dates for schedules, repeated tasks, and calendar-like recurrence rules.

Supports daily, weekly, monthly, and yearly recurrences with custom intervals, end conditions, skipped dates, and `Carbon` or `DateTimeInterface` inputs.

Useful for:

- recurring tasks
- recurring events
- appointment schedules
- reminder schedules
- repeated billing dates
- calendar-style date generation

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

[](#installation)

You can install the package via composer:

```
composer require wilianx7/php-recurring

```

Features
--------

[](#features)

- Generate recurring dates for daily, weekly, monthly, and yearly schedules
- Set recurrence end rules with `NEVER`, `IN`, or `AFTER`
- Skip specific dates with `exceptDates`
- Optionally include the start date in the generated collection
- Use `Carbon`, `DateTime`, or `DateTimeImmutable` in configuration

Basic usage
-----------

[](#basic-usage)

`RecurringConfig` accepts any `DateTimeInterface` in its date setters, so you can use `Carbon`, `DateTime`, or `DateTimeImmutable`.

- Configuration for every day recurrence ending never:

```
$startDate = new DateTimeImmutable('2019-12-26 08:00:00');
$endDate = new DateTimeImmutable('2019-12-31 23:59:59');

$recurringConfig = new RecurringConfig();

$recurringConfig->setStartDate($startDate)
    ->setFrequencyType(FrequencyTypeEnum::DAY())
    ->setFrequencyInterval(1)
    ->setFrequencyEndType(FrequencyEndTypeEnum::NEVER())
    ->setEndDate($endDate);

$dates = RecurringBuilder::forConfig($recurringConfig)->startRecurring();
```

- Configuration for weekly recurrence (Monday and Sunday) ending after 5 occurrences:

```
$recurringConfig = new RecurringConfig();

$recurringConfig->setStartDate(new DateTimeImmutable('2019-01-01 08:00:00'))
    ->setFrequencyType(FrequencyTypeEnum::WEEK())
    ->setFrequencyInterval(1)
    ->setFrequencyEndType(FrequencyEndTypeEnum::AFTER())
    ->setFrequencyEndValue(5)
    ->setRepeatIn([WeekdayEnum::MONDAY(), WeekdayEnum::SUNDAY()])
    ->setEndDate(new DateTimeImmutable('2019-12-31 23:59:59'));

$dates = RecurringBuilder::forConfig($recurringConfig)->startRecurring();
```

- Configuration for monthly recurrence (day 27) ending in 2019-11-30:

```
$recurringConfig = new RecurringConfig();

$recurringConfig->setStartDate(new DateTimeImmutable('2019-01-01 08:00:00'))
    ->setFrequencyType(FrequencyTypeEnum::MONTH())
    ->setFrequencyInterval(1)
    ->setFrequencyEndType(FrequencyEndTypeEnum::IN())
    ->setFrequencyEndValue(new DateTimeImmutable('2019-11-30 00:00:00'))
    ->setRepeatIn(27)
    ->setEndDate(new DateTimeImmutable('2019-12-31 23:59:59'));

$dates = RecurringBuilder::forConfig($recurringConfig)->startRecurring();
```

- Configuration for yearly recurrence (day 27 and month 10) ending in 2019-11-30:

```
$recurringConfig = new RecurringConfig();

$recurringConfig->setStartDate(new DateTimeImmutable('2019-01-01 08:00:00'))
    ->setFrequencyType(FrequencyTypeEnum::YEAR())
    ->setFrequencyInterval(1)
    ->setFrequencyEndType(FrequencyEndTypeEnum::IN())
    ->setFrequencyEndValue(new DateTimeImmutable('2019-11-30 00:00:00'))
    ->setRepeatIn(['day' => 27, 'month' => 10])
    ->setEndDate(new DateTimeImmutable('2019-12-31 23:59:59'));

$dates = RecurringBuilder::forConfig($recurringConfig)->startRecurring();
```

Recurring Config
----------------

[](#recurring-config)

**Attribute****Description****Default**`startDate`Date the search will start for find the dates the recurrence should be generated.Start of current year`endDate`Date the search for the dates will ended.End of current year`frequencyType`How often the recurrence will be generated accord of the enum FrequencyTypeEnum. Can be setted as: **DAY**, **WEEK**, **MONTH** or **YEAR**.FrequencyTypeEnum::DAY()`frequencyInterval`Determines the interval between recurrences according to the chosen frequency type.1`repeatIn`Determines when recurrence should be generated according to the frequency type chosen. Can be setted, for example, as: null (for **DAY**); \[ WeekdayEnum::MONDAY(), WeekdayEnum::SUNDAY() \] (for **WEEK**); 31 (for **MONTH**); \['day' =&gt; 31, 'month' =&gt; 2\] (for **YEAR**)."Null`frequencyEndType`Determines what will be the stopping criterion for recurrence generation according of the enum FrequencyEndTypeEnum. Can be setted as: **NEVER**, **IN** or **AFTER**.FrequencyEndTypeEnum::NEVER()`frequencyEndValue`Determines a value according to the chosen stop criterion. Can be setted, for example, as: null (for NEVER); 3 (for AFTER); any `DateTimeInterface` instance such as `DateTimeImmutable` or `Carbon` (for IN).Null`lastRepeatedDate`Date the last recurrence was generated. It is used to avoid unnecessary date generation by calling the generation method more than once.Null`repeatedCount`How many recurrences have already been generated. It is used to avoid unnecessary date generation by calling the generation method more than once.Null`exceptDates`Dates when recurrence should not be generated even if the date conforms to the specified setting. Accepts native array.Null`includeStartDate`Defines whether the start date should be included in the return arrayfalse- **includeStartDate**: By default, the start date is not included in the return array, as it assumes that this date is already in use, requiring only the return of subsequent dates. However, you can override this behavior by setting "includeStartDate" property as true.

Recurring Builder
-----------------

[](#recurring-builder)

**Method****Description****Return**`forConfig`Used to construct the recurrence according to setting passed by parameter.Self`startRecurring`Start generating dates for recurrenceAn array with all the dates generatedEnums
-----

[](#enums)

**Enum****Values**`FrequencyEndTypeEnum`NEVER, IN, AFTER`FrequencyTypeEnum`DAY, WEEK, MONTH, YEAR`WeekdayEnum`SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAYTesting
-------

[](#testing)

```
composer run test

```

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance91

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 97.3% 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 ~212 days

Recently: every ~106 days

Total

12

Last Release

43d ago

Major Versions

v1.0.4 → v2.0.42023-01-07

v2.1.2 → 3.0.02026-04-28

PHP version history (4 changes)v1.0.0PHP ^7.4

v2.0.4PHP ^8.1

v2.1.0PHP ^8.4

v2.1.1PHP ^8.3|^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/42422976?v=4)[Wilian Borges](/maintainers/wilianx7)[@wilianx7](https://github.com/wilianx7)

---

Top Contributors

[![wilianx7](https://avatars.githubusercontent.com/u/42422976?v=4)](https://github.com/wilianx7 "wilianx7 (36 commits)")[![Douglas-Strey](https://avatars.githubusercontent.com/u/79382237?v=4)](https://github.com/Douglas-Strey "Douglas-Strey (1 commits)")

---

Tags

calendarcarbondate-generatorphprecurrencerecurringrruleschedulephpschedulecarbonrecurringrrulerecurrencecalendarschedulingtask schedulingrecurrence-ruledate-generatorrepeat-eventsrepeat-dates

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wilianx7-php-recurring/health.svg)

```
[![Health](https://phpackages.com/badges/wilianx7-php-recurring/health.svg)](https://phpackages.com/packages/wilianx7-php-recurring)
```

###  Alternatives

[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[simshaun/recurr

PHP library for working with recurrence rules

1.6k17.2M53](/packages/simshaun-recurr)[rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

70011.9M60](/packages/rlanvin-php-rrule)[japanese-date/japanese-date

日本の暦、祝日を取り扱うライブラリ

1610.0k](/packages/japanese-date-japanese-date)

PHPackages © 2026

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