PHPackages                             matthewbdaly/laravel-cart - 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. matthewbdaly/laravel-cart

ActiveLibrary[Framework](/categories/framework)

matthewbdaly/laravel-cart
=========================

Simple Laravel shopping cart

0.0.4(7y ago)251MITPHP

Since Nov 15Pushed 7y ago2 watchersCompare

[ Source](https://github.com/matthewbdaly/laravel-cart)[ Packagist](https://packagist.org/packages/matthewbdaly/laravel-cart)[ RSS](/packages/matthewbdaly-laravel-cart/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (5)Used By (0)

laravel-cart
============

[](#laravel-cart)

[![Build Status](https://camo.githubusercontent.com/10542887b6eaddb18d973b880c541ee55987a0ce8170901338f7fddd9fa22053/68747470733a2f2f7472617669732d63692e6f72672f6d6174746865776264616c792f6c61726176656c2d636172742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/matthewbdaly/laravel-cart)[![Coverage Status](https://camo.githubusercontent.com/e7300fa183e6ee6771727f83b3c009346850014bc4f5067e0db56e3417d074b3/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6174746865776264616c792f6c61726176656c2d636172742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/matthewbdaly/laravel-cart?branch=master)

Simple shopping cart implementation for Laravel. Loosely inspired by CodeIgniter's cart class.

Installation
------------

[](#installation)

```
composer require matthewbdaly/laravel-cart

```

Usage
-----

[](#usage)

The cart implements the interface `Matthewbdaly\LaravelCart\Contracts\Services\Cart`, so you can use that to type-hint it. Alternatively you can use the `Cart` facade.

Add item
--------

[](#add-item)

To add an item, call `$cart->insert($data)`. In this case `$data` must be an array with the following fields:

- `qty`
- `price`
- `name`
- `options`

OR an array of items, each with the same fields. You can also add any additional data you wish.

Get all items
-------------

[](#get-all-items)

Call `$cart->all()` to retrieve the contents.

Get single item
---------------

[](#get-single-item)

Call `$cart->get($rowId)` to retrieve an item by its row ID.

Update single item
------------------

[](#update-single-item)

Call `$cart->update($rowId, $data)` to update an item with the provided data.

Remove item
-----------

[](#remove-item)

Call `$cart->remove($rowId)` to remove an item.

Get total price
---------------

[](#get-total-price)

Call `$cart->total()` to get the total price.

Get total items
---------------

[](#get-total-items)

Call `$cart->totalItems()` to get a count of the items. Note that this does not allow for the quantity - if you have item X with a quantity of 2, that will be 1 item in the count.

Destroy cart
------------

[](#destroy-cart)

Call `$cart->destroy()` to destroy the cart.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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 ~81 days

Total

4

Last Release

2857d ago

### Community

Maintainers

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

---

Top Contributors

[![matthewbdaly](https://avatars.githubusercontent.com/u/450801?v=4)](https://github.com/matthewbdaly "matthewbdaly (52 commits)")

---

Tags

cartlaravelphpshopping-cartlaravelcartshoppingbasket

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/matthewbdaly-laravel-cart/health.svg)

```
[![Health](https://phpackages.com/badges/matthewbdaly-laravel-cart/health.svg)](https://phpackages.com/packages/matthewbdaly-laravel-cart)
```

###  Alternatives

[lukepolo/laracart

A simple cart for Laravel

583135.4k1](/packages/lukepolo-laracart)[jackiedo/cart

A package used to create and manage carts (such as shopping, recently viewed, compared items...) in Laravel application.

20852.7k](/packages/jackiedo-cart)[getcandy/core

GetCandy Laravel e-commerce core functionality.

156.6k3](/packages/getcandy-core)

PHPackages © 2026

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