divineomega/dates-timezone-conversion-trait
date/datetime casts means existing models keep working after adoption — no need to audit and rewrite every $dates/$casts declaration before shipping.Adopt it when most of the following hold:
$dates properties and modern $casts entries that you cannot migrate in one go.Look elsewhere or stay in-framework when:
datetime casts plus a thin display helper — the marginal value shrinks.For executives: We have a correctness bug class — dates entered by users in different regions are stored inconsistently, which produces wrong reminders, wrong deadlines, and reporting numbers that don't reconcile. This release lets us fix that with a one-line dependency instead of a schema migration and a rewrite of every date-handling endpoint. It is backward compatible, ships null-safety and a fix for a subtle data-corruption bug where reading a date could silently alter the record, and it works across our entire Laravel/PHP version range — so it is not coupled to any upgrade project we have planned. Cost is near zero; the risk of not doing it is a continuing stream of timezone support tickets and untrustworthy timestamps.
For engineering: v3.1.0 gives us user-timezone input parsing, app-timezone storage, null passthrough, and coverage for both legacy $dates and date/datetime casts. Two behavioural notes before you merge: returned Carbon instances are now clones, so any code relying on mutating a returned date object will no longer affect the model (this is the correct behaviour, but it is a change); and the declared support window (Laravel 5.1–13, PHP 5.5.9) is broad enough that we should confirm which combinations are actually exercised in CI and pin our own integration test to our combination. Adoption is a single Composer require plus swapping the cast on the models that need it — no migrations, no data backfill.
How can I help you explore Laravel packages today?