PHPackages                             whilesmart/eloquent-scheduling - 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. whilesmart/eloquent-scheduling

ActiveLibrary

whilesmart/eloquent-scheduling
==============================

Attach one-shot or recurring (RRULE) schedules to any Eloquent model and fire them through a runner event.

046PHP

Since Jul 12Pushed 1mo agoCompare

[ Source](https://github.com/whilesmartphp/eloquent-scheduling)[ Packagist](https://packagist.org/packages/whilesmart/eloquent-scheduling)[ RSS](/packages/whilesmart-eloquent-scheduling/feed)WikiDiscussions dev Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

whilesmart/eloquent-scheduling
==============================

[](#whilesmarteloquent-scheduling)

Attach a schedule to any Eloquent model and fire it when it is due. One model, two modes: a one-shot that runs once at a set time, or a recurring schedule driven by an RRULE. A runner command fires every due schedule and emits an event your app listens for, so the same substrate powers recurring transactions, reminders, digests, and recurring agent actions. Each schedule is scoped to an owner (a workspace, organization, user) through [`whilesmart/eloquent-owner-access`](https://github.com/whilesmartphp/eloquent-owner-access).

Install
-------

[](#install)

```
composer require whilesmart/eloquent-scheduling
php artisan migrate

```

Routes register automatically under the `api` prefix with `auth:sanctum`. Set `SCHEDULING_REGISTER_ROUTES=false` to mount them yourself.

Attaching schedules
-------------------

[](#attaching-schedules)

`Schedulable` gives a model the schedules pointed at it (the thing being scheduled); `HasSchedules` gives an owner the schedules it owns.

```
use Whilesmart\Scheduling\Traits\Schedulable;

class Invoice extends Model
{
    use Schedulable;
}

$invoice->schedules()->create([
    'owner_type' => Workspace::class,
    'owner_id' => $workspace->id,
    'mode' => 'recurring',
    'rrule' => 'FREQ=MONTHLY;BYMONTHDAY=1',
    'timezone' => 'Europe/Berlin',
]);
```

`next_run_at` is computed when the schedule is created (from `run_at` for a one-shot, or the first RRULE occurrence for a recurring one) and advanced each time it fires.

Firing due schedules
--------------------

[](#firing-due-schedules)

Run the command every minute from the host scheduler:

```
// app/Console/Kernel.php (or bootstrap/app.php on Laravel 11+)
$schedule->command('schedules:run')->everyMinute();
```

`schedules:run` loads every due schedule, dispatches `Whilesmart\Scheduling\Events\ScheduleDue($schedule)`, then advances it: a one-shot deactivates, a recurring schedule moves to its next occurrence. Listen for the event to do the actual work:

```
use Whilesmart\Scheduling\Events\ScheduleDue;

Event::listen(function (ScheduleDue $event) {
    $schedule = $event->schedule;      // owner, schedulable, metadata
    // post the recurring transaction, send the reminder, run the agent action...
});
```

Endpoints
---------

[](#endpoints)

MethodPathPurposeGET`/api/schedules`List (filter by `mode`, `active`, `due`, owner, schedulable)POST`/api/schedules`CreateGET`/api/schedules/{schedule}`ShowPUT/PATCH`/api/schedules/{schedule}`UpdateDELETE`/api/schedules/{schedule}`Soft deleteModes
-----

[](#modes)

`ScheduleMode`: `once`, `recurring`. A one-shot needs `run_at`; a recurring schedule needs an `rrule` (any string `rlanvin/php-rrule` accepts, e.g. `FREQ=WEEKLY;BYDAY=MO`) and honours `timezone`.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance59

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a1ca6f6e01ecbfe6640ff410c4f0321054fb48d05a5f843c2b89887b90369bcd?d=identicon)[whilesmart](/maintainers/whilesmart)

---

Top Contributors

[![nfebe](https://avatars.githubusercontent.com/u/14317775?v=4)](https://github.com/nfebe "nfebe (1 commits)")

### Embed Badge

![Health badge](/badges/whilesmart-eloquent-scheduling/health.svg)

```
[![Health](https://phpackages.com/badges/whilesmart-eloquent-scheduling/health.svg)](https://phpackages.com/packages/whilesmart-eloquent-scheduling)
```

PHPackages © 2026

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