grisaia/time
A lightweight Laravel time utility package offering helpers for formatting, parsing, and comparing dates and times. Integrates with Carbon to simplify common time-related tasks, with a clean API and simple configuration. Designed to keep date logic consistent across your project.
Carbon::setTestNow() test helpers. The real decision isn't "should we use it" but "do we want a framework-agnostic domain time type, with Carbon confined to the framework edges?"DateTime in a loop, DST arithmetic in scheduling, and off-by-one in billing-period boundaries. If the roadmap has booking windows, subscription renewal dates, trial expiries, or timezone-dependent reporting, this is a defensible quality investment.Adopt (or, more precisely, trial) when all of the following hold:
declare(strict_types=1) and static analysis, and is comfortable with result-style APIs over exceptions.Clock/Timestamp adapter — so the package is a swappable implementation detail, not a public dependency.Look elsewhere (i.e., stay on Carbon / DateTimeImmutable) when:
CarbonPeriod, interval math, human-readable diffs, localization and i18n formatting, Blade-friendly output, and the entire Laravel testing ergonomics around setTestNow().Recommended path: a one-to-two day spike in an isolated module behind an adapter, with an explicit kill criterion. Don't standardize org-wide on a 0-star package in one move.
To executives: This is a free, MIT-licensed library that reduces a specific and expensive class of bug — incorrect dates in billing, scheduling, and reporting — by making time values immutable and making failures explicit instead of silently swallowed. Cost is zero and the blast radius is contained because we will hide it behind our own interface; if it disappoints, we swap the implementation without touching business logic. The honest caveat: it is an early, unproven package with one maintainer and no adoption, so this is a small, reversible bet rather than a platform commitment. We'll validate with a short spike and a written go/no-go criterion before it touches revenue-critical paths.
To engineering: It's the "make invalid states unrepresentable" option for time. Strict types, immutable values, and no exceptions means fewer hidden mutations, no try/catch pyramids, and a codebase that plays well with high static-analysis levels. It also decouples domain logic from Carbon, which is the main thing keeping our business rules welded to the framework. The trade-off is real: we lose Carbon's breadth and Laravel's testing conveniences, so the proposal is Carbon at the edges (Eloquent casts, validation, Blade) and this type in the domain core — with an adapter we own so the choice stays reversible.
How can I help you explore Laravel packages today?