eventsauce/clock
Simple clock abstraction for PHP. Use SystemClock in production and TestClock in tests to control time deterministically. Get now() as DateTimeImmutable, access timeZone(), move time forward, tick to system time, or fixate to a specific moment.
Carbon or DateTime suffice).For Executives: "This lightweight package lets us treat time as a pluggable dependency—critical for our event-driven architecture. It’s like a ‘time freeze’ button for tests, ensuring our scheduling and compliance features work flawlessly in staging and production. Minimal overhead, but massive payoff for reliability and developer velocity."
For Engineering:
*"Clock decouples real time from business logic, making our event-sourced workflows testable and deterministic. Swap the real SystemClock with a MockClock in tests—no more flaky time-based failures. Works seamlessly with Laravel’s service container. Let’s use it for:
UTCClock for consistency across regions.How can I help you explore Laravel packages today?