Laravel Cadence

Alpha

An open-source package that runs your application in accelerated simulated time. Your Eloquent models, queued jobs, scheduled commands — everything operates exactly like production, just faster. Seed your data, implement a tick handler, and watch weeks of application behavior unfold in minutes.


Cadence works by hijacking Carbon's setTestNow() to globally advance the clock on a configurable tick loop. Because Laravel's internals all use Carbon under the hood, everything just... respects it. Timestamps, cache TTLs, scheduled tasks — they all think it's Tuesday at 3 PM if Cadence says it's Tuesday at 3 PM. (Skynet wishes it had this kind of control over time.)

The package ships with a simulation-aware queue processor that evaluates job readiness against simulated time instead of real time, so a job delayed by 48 hours actually fires after 48 simulated hours. Same deal for scheduled commands — no cron dependency, the runner walks through each tick and fires anything that would have been due.

Developers interact with Cadence through a TickHandler contract: implement boot(), onTick(), and shutdown(), and you're off. The TickContext object passed to each tick gives you the current simulated time, tick number, speed multiplier, and a scheduling DSL so you're not writing time-checking boilerplate everywhere. Need something to happen every 30 minutes on weekdays? That's $context->weekdays()->every('30 minutes', 'my-task', fn() => ...).

Cross-process state lives in cache, so a web dashboard can read simulation status, send pause/resume signals, and adjust speed without sharing the time context. Database snapshots let you reset to a known state in seconds for repeatable runs. And an event log (database or JSONL) captures everything your handlers write, queryable and streamable.

The whole thing targets Laravel 12, ships under MIT, and stays firmly in its lane — Cadence is the simulation infrastructure. What you simulate (personas, LLM agents, e-commerce flows, chaos testing) is up to you.

Started

Stay in the loop

Get notified when I publish new articles and ship new projects.