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

Laravel Carbon 2 Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Legacy upgrade unblocking. For applications pinned to Laravel 5.5–5.7, this adapter is a tactical answer to "we need Carbon 2 date semantics (immutable dates, richer diffing, 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.
  • Build vs. buy (buy vs. hand-roll). The alternative is writing your own 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.
  • Feature delivery where date correctness is customer-visible. Billing proration, scheduling, subscription renewals, trial expiry, report bucketing, and locale-aware formatting are places where Carbon 1's quirks become bug tickets. If Carbon 2 semantics are on the roadmap, this is a cheap enabler.
  • Roadmap sequencing input. Its existence is a signal to the roadmap: "Carbon 2 is a dependency upgrade, not a feature." It argues for scheduling a Laravel upgrade (5.8+ ships Carbon 2 natively) rather than investing in long-lived shims.
  • Risk-bounded scope for a spike. A one-sprint experiment behind a feature branch, validated against the date-heavy parts of the test suite, is a legitimate way to answer "how much Carbon 2 pain do we actually have?"

When to Consider This Package

Adopt only when all of the following hold:

  • The application is on Laravel 5.5–5.7 (or a fork/derivative that pins Carbon 1) and a framework upgrade is not funded this quarter.
  • You have a concrete, named need for Carbon 2 behavior — immutable date objects, CarbonPeriod, improved diffForHumans, setTestNow ergonomics in tests — not a vague "newer is better."
  • Your date logic is well-covered by tests (timezones, DST boundaries, month-end arithmetic, serialization to JSON/DB). This adapter changes class resolution; regressions surface in date math, not at compile time.
  • Your dependency graph allows it: no other package hard-requires Carbon 1 semantics in a way that conflicts.
  • You accept the maintenance profile: last release August 2018, ~63 stars, effectively a single-maintainer artifact. Treat it as vendored glue with an exit plan, not a long-term platform dependency.

Look elsewhere (i.e., do not adopt) when:

  • You are on Laravel 5.8+ or 6+ — Carbon 2 support is native; this package adds nothing and only adds an unmaintained dependency.
  • You are planning PHP 8+, Laravel 9/10/11, or Carbon 3 — the adapter's supported matrix predates all of it; you are choosing an archaeological dig over an upgrade.
  • Your organization requires active security response, SLAs, or a maintained release cadence — no releases in 6+ years fails that bar.
  • The real problem is "we should upgrade Laravel" — using this package to defer the upgrade converts a known, scheduled cost into an unbounded, unowned one.
  • You need Carbon 2 features in one isolated service — inject a small date-service abstraction (or use nesbot/carbon directly in a non-Laravel namespace) instead of reshaping the framework's global Carbon class.

How to Pitch It (Stakeholders)

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.

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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
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