kylekatarnls/laravel-carbon-2
Integrates Carbon 2 into Laravel apps that still ship Carbon 1. Swap the bundled Carbon for the newer API—localization, diff methods, immutable dates—without upgrading your framework. A drop-in compatibility bridge for older Laravel versions.
CarbonPeriod, better timezone/ISO handling) but the framework still hard-wires Carbon 1." It lets a team adopt Carbon 2 features without a framework upgrade train.class_alias and composer constraint gymnastics in AppServiceProvider / a patched Illuminate\Support\Carbon. This package packages that hack with test coverage and a documented constraint set — a small, reversible buy decision rather than bespoke glue code your team must own.Adopt only when all of the following hold:
CarbonPeriod, improved diffForHumans, setTestNow ergonomics in tests — not a vague "newer is better."Look elsewhere (i.e., do not adopt) when:
nesbot/carbon directly in a non-Laravel namespace) instead of reshaping the framework's global Carbon class.To executives: This is a small, MIT-licensed compatibility shim — not a product, not a platform. It buys us the ability to use a modern date library on an older Laravel version, which matters where date handling is customer-visible (billing, scheduling, renewals). Cost is near zero and the decision is reversible. The risk is equally clear: the package has had no release since 2018, so we treat it as temporary scaffolding with a dated exit — the strategic move remains upgrading Laravel, where this capability is free and supported.
To engineering: One sentence — it lets a Laravel 5.5–5.7 app resolve Carbon\Carbon to Carbon 2 so framework internals and app code keep working while you use Carbon 2 APIs. Ask for: (1) a time-boxed spike on a branch, (2) full green on date/timezone/DST/serialization tests before merge, (3) a one-line composer constraint pin plus a documented owner, (4) an explicit ticket to remove it at the next Laravel upgrade. If any of those four can't be agreed, don't take the dependency — write the alias yourself in ten lines and keep the maintenance in-house.
Bottom line: a defensible tactical choice for legacy Laravel needing Carbon 2 semantics, and the wrong choice as a durable dependency or as a substitute for the framework upgrade.
How can I help you explore Laravel packages today?