PHPackages                             kylekatarnls/laravel-carbon-2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kylekatarnls/laravel-carbon-2

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kylekatarnls/laravel-carbon-2
=============================

Carbon 2 adapter for Laravel

1.0.0(7y ago)631.2M↓13.1%11MITPHP

Since Aug 17Pushed 3y ago2 watchersCompare

[ Source](https://github.com/kylekatarnls/laravel-carbon-2)[ Packagist](https://packagist.org/packages/kylekatarnls/laravel-carbon-2)[ Docs](http://carbon.nesbot.com)[ RSS](/packages/kylekatarnls-laravel-carbon-2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (1)

⚠️ Laravel &lt; 6.20.42 versions all [have security issues](https://packagist.org/packages/laravel/framework/advisories?version=1306238)and are no longer supported for years. You MUST upgrade to a newer and safer version of Laravel if your still running an older version.

This package helps you upgrading Carbon first if needed but as Laravel &gt;= 6.20.42 all embed Carbon 2, you won't need this package if you can instead upgrade Laravel.

laravel-carbon-2
================

[](#laravel-carbon-2)

Carbon 2 adapter for Laravel

To install Carbon 2 in your Laravel project, add the following dependencies to your **composer.json**:

```
{
  ...
  "require": {
    ...
    "kylekatarnls/laravel-carbon-2": "^1.0.0",
    "nesbot/carbon": "2.27.0 as 1.39.0"
  }
  ...
}
```

Then run:

```
composer update

```

Do I need this package?
-----------------------

[](#do-i-need-this-package)

Only if you're using Laravel &lt; 6 as it requires Carbon version 1 (with various minimum and maximum minor versions).

So we need first to set the nesbot/carbon to 2.x version and add an alias so it won't conflict with the inner Carbon version required by Laravel.

Then, Laravel extends the Carbon class to add JSON serialization and macros. The way macros are implemented is not compatible with Carbon 2. And JSON serialization and macros are still there in Carbon since version 1.26.0 and work exactly the same way. That's why they could be safely removed when working with Carbon 2.

So we install **kylekatarnls/laravel-carbon-2** that basically "removes" the no longer needed overrides of Laravel Carbon class by providing a replacement Illuminate\\Support\\Carbon class that comes with no overrides and have the precedence over the Laravel's class.

This package is not a long-term solution, just a temporary helper before proper upgrade
---------------------------------------------------------------------------------------

[](#this-package-is-not-a-long-term-solution-just-a-temporary-helper-before-proper-upgrade)

Laravel &lt; 6 versions all [have security issues](https://packagist.org/packages/laravel/framework/advisories?version=1306238)and are no longer supported for years. You MUST upgrade to a newer and safe version of Laravel:

Install and keep updated to get latest security fixes:

You can also check seuciry issues for each version on:

Then because all those version use Carbon 2 by default, you no longer need this package once upgraded.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2831d ago

Major Versions

0.1.0 → 1.0.02018-08-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/df90c422f521bf26355c3e185a59fe7afb35531af56244dfaec03ee1d0ca6f24?d=identicon)[kylekatarn](/maintainers/kylekatarn)

---

Top Contributors

[![kylekatarnls](https://avatars.githubusercontent.com/u/5966783?v=4)](https://github.com/kylekatarnls "kylekatarnls (6 commits)")[![erlangparasu](https://avatars.githubusercontent.com/u/20636828?v=4)](https://github.com/erlangparasu "erlangparasu (1 commits)")

---

Tags

laravelcarbon

### Embed Badge

![Health badge](/badges/kylekatarnls-laravel-carbon-2/health.svg)

```
[![Health](https://phpackages.com/badges/kylekatarnls-laravel-carbon-2/health.svg)](https://phpackages.com/packages/kylekatarnls-laravel-carbon-2)
```

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
