PHPackages                             ismail1k/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ismail1k/laravel-cart

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

ismail1k/laravel-cart
=====================

A simple Shopping Cart system for e-commerce projects for Laravel.

1.0.0(3y ago)05MITPHPPHP &gt;=7.2.0

Since Oct 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ismail1k/laravel-cart)[ Packagist](https://packagist.org/packages/ismail1k/laravel-cart)[ RSS](/packages/ismail1k-laravel-cart/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

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

[](#laravel-cart)

A simple Shopping Cart system for e-commerce projects for Laravel.

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

[](#installation)

First, add `ismail1k/laravel-cart` package to your laravel project using Composer:

```
composer require "ismail1k/laravel-cart"
```

then add these follow lines to `config/app.php`:

```
  'providers' => [
      Ismail1k\LaravelCart\ServiceProvider::class,
  ],
  'aliases' => [
      'Cart' => Ismail1k\LaravelCart\CartServiceProvider::class,
  ],
```

Next step, add some published files like migrations:

```
php artisan vendor:publish --provider="Ismail1k\LaravelCart\ServiceProvider"
```

then run the follow line:

```
php artisan migrate
```

Usage
-----

[](#usage)

Use class `Cart` using:

```
use Cart;
```

Select your cart with:

```
$cart = Cart::get($cart_token);
```

Or you can create new one with:

```
$cart = Cart::create($user_id = null);  //It by default null but if you want to link that created cart to a specified user, You can pass `user_id` parameter.
```

Add some product to your cart with:

```
Cart::add($cart_token, $product_id, $quantity = 1); //The default quantity is 1, that means if you don't specify the quantity, 1 will be added automatically.
```

`Note:` If you assign 2 to a product that already has 1 quantity, it will be 2, not 3.

Remove one item from cart with:

```
Cart::removeItem($product_id);
```

If you want to remove all products from the cart with a single action, you can do so with:

```
Cart:clear($cart_token);
```

Or you can destroy cart with:

```
Cart::destroy($cart_token);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Unknown

Total

1

Last Release

1295d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76727a321db66ff0037ada6c509166516e3932c78d365d29f40afc31b42c8c99?d=identicon)[ismail1k](/maintainers/ismail1k)

---

Top Contributors

[![ismail1k](https://avatars.githubusercontent.com/u/57640444?v=4)](https://github.com/ismail1k "ismail1k (47 commits)")

### Embed Badge

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

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

PHPackages © 2026

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