Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Symfony Time Machine Laravel Package

icanhazstring/symfony-time-machine

Symfony Time Machine makes time-dependent Symfony code testable by letting you freeze, advance, or reset the application clock. Use it to create deterministic tests and simulate past or future dates without changing your system time.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test-environment strategy for time-dependent behavior. Anything with a clock in it — trial expirations, billing cycle boundaries, proration, promo windows, "N days since signup" counters, retention/aging reports, cron windows, SLA timers — needs to be exercised at arbitrary dates. This package is a candidate for the "how do we make time controllable?" decision in our test strategy.
  • Buy vs. build for a time-travel capability. The honest comparison is: adopt a bundle, vendor a small internal implementation, or rely on language/framework primitives (Carbon::setTestNow, Symfony's Clock/MockClock, PHPUnit's ClockMock). This is a small enough surface area that "build" is genuinely on the table.
  • QA and demo enablement. If the decision is to let non-engineers (QA, support, sales engineers) shift the app's clock in staging to reproduce a bug or demo an expired-promo flow, this is one of the few off-the-shelf options — and it changes who can validate the product without a deploy.
  • Scope of a "time control" feature in our own admin tooling. If we conclude we need an in-app control surface (a debug panel or console command to set the clock), this package is a reference design and a floor for effort estimation, not necessarily the dependency to ship. The new handler layer in 0.1.1 is now the most reusable piece of that reference: it shows a pluggable seam for "how a time-shift request gets applied," which is exactly the extension point we'd otherwise have to invent.
  • Risk posture on long-tail dependencies. Still 7 stars, 0 dependents, single maintainer, and a ~3-year gap between 0.1.0 (Oct 2022) and 0.1.1. The new release softens "abandoned" to "intermittent," but it's a feature patch rather than a support commitment (no version-support statement, still pre-1.0). Fine as a live example for our dependency-review policy: what bar does a dev-only, single-maintainer package have to clear?

When to Consider This Package

Consider it when all of the following hold:

  • We are on Symfony (the package is a Symfony bundle). Note the brief framed this as a Laravel/PHP package — it is not; on a Laravel codebase the bundle itself is not consumable, and the relevant decision becomes "do we build the equivalent with the framework's clock primitives?"
  • The app has meaningful time-dependent business logic and the gap is specifically outside unit tests — i.e., we need to shift time in a running HTTP app (staging, QA, demo), not just inside a PHPUnit process.
  • We can hard-gate it to dev/test and never ship it to production. A dependency whose purpose is to change what "now" means is a production risk with no upside.
  • Someone owns it. At 0 dependents and an irregular cadence, we should be prepared to fork or vendor it, so the cost of taking it is really the cost of maintaining a small fork. Post-0.1.1 that fork is slightly cheaper to maintain (a handler seam to extend rather than patch core), and slightly riskier to track (0.x means the handler contract can move in any patch).
  • We pin exactly. Pre-1.0 with a maintainer now actively reshaping the API means ~0.1.1 and a lockfile, not ^0.1.

Look elsewhere when:

  • We are on Laravel, or on Symfony with a modern ClockInterface-based setup where MockClock/ClockMock and Carbon::setTestNow already cover the need with zero new dependencies. For pure test-time control, primitives are the default answer.
  • We need per-request or per-user time isolation (e.g., one QA session at T+30 and another at T+90 simultaneously). A single application-wide clock shift generally won't satisfy that; the 0.1.1 handler concept is a starting point but not evidence of request scoping — we'd still need a header-scoped clock we control ourselves.
  • We need maintenance guarantees — security patching SLAs, PHP/Symfony version support commitments, or a vendor relationship. The 0.1.1 release is a positive signal but not a commitment; one patch after a three-year gap doesn't establish cadence.
  • We only need scheduled-job or report testing, where injecting a clock service into our own code is a cleaner, permanent architectural improvement than a bundle.

How to Pitch It (Stakeholders)

For executives (one paragraph): Time is an input to a lot of our product logic — trials, billing boundaries, expirations, aging reports — and today validating that logic at arbitrary dates is slow and engineer-dependent. There's a small open-source Symfony bundle that lets a running app shift its own clock, which would let QA and support reproduce and demo time-based scenarios without code changes or deploys. It just shipped its first update since 2022, adding an extensibility hook, which is a mild positive on maintenance — but it's still a lightly-used, single-maintainer, pre-1.0 project with no support commitments. My recommendation is unchanged: treat it as a design reference and a two-day spike, not a committed dependency. The likely outcome is that we build a small, gated, in-house equivalent — borrowing its handler pattern — or adopt standard framework clock primitives, and keep control of the maintenance.

For engineering: This is a Symfony bundle, not Laravel — so on a Laravel codebase the concrete ask is to copy the pattern, not the package. It shifts the application's clock so time-dependent code can be exercised in a live environment; that's valuable in staging/QA and unacceptable in production, so any adoption means dev-only registration, environment guards, and access control. 0.1.1 adds a pluggable handler layer (icanhazstring, PR #4) — read that first, because it's the genuinely reusable idea and the natural seam if we fork. Before we take the dependency, benchmark against symfony/clock's MockClock, PHPUnit's ClockMock, and Carbon::setTestNow; for in-process tests those are almost certainly sufficient and cost us nothing to maintain. The remaining gap worth solving — if it exists for us — is out-of-process time control for QA and demos, which is a small service we can own in a few days. Given 0 dependents, a single maintainer, and pre-1.0 semantics where a patch can change the handler contract, plan to vendor or fork if we proceed, pin the exact version, and timebox the spike.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk