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(6mo ago)23MITPHPPHP ^8.4CI passing

Since Dec 28Pushed 6mo 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 today

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

33

—

LowBetter than 72% of packages

Maintenance68

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

187d 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

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.3k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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