PHPackages                             pajaeu/carton - 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. [Framework](/categories/framework)
4. /
5. pajaeu/carton

ActiveLibrary[Framework](/categories/framework)

pajaeu/carton
=============

The missing cart package for Laravel.

v0.2.1(4mo ago)23MITPHPPHP ^8.4CI passing

Since Dec 28Pushed 4mo agoCompare

[ Source](https://github.com/pajaeu/carton)[ Packagist](https://packagist.org/packages/pajaeu/carton)[ Docs](https://github.com/pajaeu/carton)[ GitHub Sponsors](https://github.com/pajaeu)[ RSS](/packages/pajaeu-carton/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (9)Versions (4)Used By (0)

 [![Carton logo](./art/logo.png)](./art/logo.png)

 [![Packagist](https://camo.githubusercontent.com/6853ba36d237c70acf619643f0f1492ce3d639fa5aa51e2254bda4c0f0e9b3c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70616a6165752f636172746f6e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/pajaeu/carton) [![Tests](https://camo.githubusercontent.com/6b84c7f9194679ea95c5fd9b458fe4a66f0e2c67ce1198fac6d6dcab0a48b93b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70616a6165752f636172746f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c6174)](https://github.com/pajaeu/carton/actions?query=workflow%3Arun-tests+branch%3Amain) [![Laravel version](https://camo.githubusercontent.com/d950a528dfd8d95d0be96be6b0f3da7d5c688b4fa64d4ef0ca0e8400f10c96ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322e302532422d4646324432303f7374796c653d666c6174266c6f676f3d6c61726176656c)](https://laravel.com) [![Total downloads](https://camo.githubusercontent.com/f59e44004da87279c9de1507201df50f134a95c635ca59f82af9a6d465d3485d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70616a6165752f636172746f6e2e7376673f7374796c653d666c6174)](https://packagist.org/packages/pajaeu/carton) [![Total downloads](https://camo.githubusercontent.com/17f1618fb4616754d3ef5c166a28bed73b8da218993c88b182d3da395ecfb6c3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70616a6165752f636172746f6e3f7374796c653d666c6174)](./LICENSE.md)

---

**Carton** is the missing cart package for Laravel.

📦 Installation
--------------

[](#-installation)

Install package via composer

```
composer require pajaeu/carton
```

Then publish configuration and migrations

```
php artisan carton:install
```

🚀 How to use Carton
-------------------

[](#-how-to-use-carton)

```
// create cart using custom currency code
Carton::createCart('CZK');

// if we do not pass currency code, it uses default one specified in config
Carton::createCart();

// then we need to create new data
$data = new CartLineData(
    'Product 1',
    300,
    21,
    [
        'size' => [
            'XS',
        ],
    ]
);

// so we can pass it to the addLine method also with the quantity parameter
Carton::addLine($data, 2);

// we can recalculate cart's totals so we have everything right (it is being made automatically when calling adding new line)
Carton::recalculate();

// then we can get the cart model and its properties
$cart = Carton::getCart();

echo 'Total items in cart: '.$cart->count;
echo 'Totals to pay: '.$cart->grand_total_with_vat.' '.$cart->currency_code;

// we can also get some current cart's properties using the facade
echo 'Totals to pay: '.Carton::getCartTotal().' '.Carton::getCartCurrencyCode();

// we can access lines on the cart model
$lines = $cart->lines;

// or you can get lines using the facade (returns empty collection if cart is not created yet)
$lines = Carton::getCartLines();
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance81

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

3

Last Release

131d ago

### Community

Maintainers

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

---

Top Contributors

[![pajaeu](https://avatars.githubusercontent.com/u/82808974?v=4)](https://github.com/pajaeu "pajaeu (59 commits)")

---

Tags

basketcartecommercelaravellaravel-basketlaravel-cartlaravel-cart-packagelaravel-ecommercelaravel-packagephp

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pajaeu-carton/health.svg)

```
[![Health](https://phpackages.com/badges/pajaeu-carton/health.svg)](https://phpackages.com/packages/pajaeu-carton)
```

###  Alternatives

[lunarstorm/laravel-ddd

A Laravel toolkit for Domain Driven Design patterns

17959.0k](/packages/lunarstorm-laravel-ddd)[bezhansalleh/filament-plugin-essentials

A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster

27584.7k16](/packages/bezhansalleh-filament-plugin-essentials)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)[jonpurvis/squeaky

A Laravel Validation Rule to Help Catch Profanity.

706.0k](/packages/jonpurvis-squeaky)[camya/filament-title-with-slug

TitleWithSlugInput - Easy Permalink Slugs for the FilamentPHP Form Builder (PHP / Laravel / Livewire)

13444.5k](/packages/camya-filament-title-with-slug)

PHPackages © 2026

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