PHPackages                             bobkingstone/pedlar-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. bobkingstone/pedlar-cart

AbandonedLibrary

bobkingstone/pedlar-cart
========================

A simple drop in shopping cart for laravel ecommerce sites

v0.2.0(11y ago)0561MITPHPPHP &gt;=5.4.0

Since Aug 15Pushed 11y ago1 watchersCompare

[ Source](https://github.com/BobKingstone/Pedlar-Cart)[ Packagist](https://packagist.org/packages/bobkingstone/pedlar-cart)[ RSS](/packages/bobkingstone-pedlar-cart/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Pedlar-Cart Laravel Package
===========================

[](#pedlar-cart-laravel-package)

[![Build Status](https://camo.githubusercontent.com/70cc00b2f7a160dfafe28a4e07d0372b6abb4154036331d003f0620bedf5ca57/68747470733a2f2f7472617669732d63692e6f72672f426f624b696e6773746f6e652f5065646c61722d436172742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/BobKingstone/Pedlar-Cart)[![Latest Stable Version](https://camo.githubusercontent.com/1df1e789eeed2d9cd04340be8a08aef36bae8e38aadc843f6a8296266228ef5d/68747470733a2f2f706f7365722e707567782e6f72672f626f626b696e6773746f6e652f7065646c61722d636172742f762f737461626c652e737667)](https://packagist.org/packages/bobkingstone/pedlar-cart) [![Total Downloads](https://camo.githubusercontent.com/ad4ea1a74e68b586db4b47a98a72e1f3e9fbd9534505d6ccf09ae3bf3f611600/68747470733a2f2f706f7365722e707567782e6f72672f626f626b696e6773746f6e652f7065646c61722d636172742f646f776e6c6f6164732e737667)](https://packagist.org/packages/bobkingstone/pedlar-cart) [![Latest Unstable Version](https://camo.githubusercontent.com/42e99d5eb24291b987edee2967f2a7dedd6f5ba2725ddf5ac1acf35d3a87ada0/68747470733a2f2f706f7365722e707567782e6f72672f626f626b696e6773746f6e652f7065646c61722d636172742f762f756e737461626c652e737667)](https://packagist.org/packages/bobkingstone/pedlar-cart) [![License](https://camo.githubusercontent.com/3cd83dc16fc1333bf6a489b81612b2d1d8430a6558a1ef3347e97df74e9cda48/68747470733a2f2f706f7365722e707567782e6f72672f626f626b696e6773746f6e652f7065646c61722d636172742f6c6963656e73652e737667)](https://packagist.org/packages/bobkingstone/pedlar-cart)

Laravel e-commerce shopping cart package. It uses Laravel's Session class by default.

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

[](#installation)

Add bobkingstone/pedlar-cart to your composer.json

```
"require": {
    "bobkingstone/pedlar-cart": "dev-master"
}

```

Run composer update

```
composer update

```

Once this has completed add the service provider to the array of providers in `app/config/app.php`

```
'Bobkingstone\PedlarCart\PedlarCartServiceProvider'

```

Usage
-----

[](#usage)

The package generates a 'Cart' facade for the package automatically so there is no need to add it to the alias array.

To add an item to the cart:

```
$item = array(
    'id => '1', //your cart id
    'qty' => 2,
    'price' => 200.00,
);

$CartItemIdentifier = Cart::insert($item);

```

To get the total number of all items in cart:

```
Cart::countItems();

```

To get an array of CartItems from cart:

```
Cart::all();

```

To access cart items values:

```
foreach (Cart::all() as $item)
{
    echo $item->id;
    echo $item->price;
    echo $item->qty;
};

```

To get the total value of all items in cart:

```
Cart::totalValue();

```

To get a count of unique items in cart:

```
Cart::totalUniqueItems();

```

To empty the cart:

```
Cart::clear();

```

To set tax rate, you can either add it to each item:

```
$item = array(
    'id => '1',
    'qty' => 2,
    'tax' => 20,
    'price' => 200.00,
);

Cart::totalWithTax();

```

Or pass in the percentage with the cart total calculation (this will override each items predefined tax rate):

```
Cart::totalWithTax(20);

```

To update an item

```
$item = Cart::find('91936a0df88d531b5a770b614cd3c1ea');

$item->update('qty','3');

```

This will replace the existing value, to add to the quantity add the same item:

```
$item = array(
        'id => '1',
        'qty' => 2,
        'price' => 200.00,
    );

Cart::insert($item);

```

The item quantity will automatically be added.

To remove a single item from cart:

```
Cart::remove('91936a0df88d531b5a770b614cd3c1ea');

```

Exceptions
----------

[](#exceptions)

The package will throw InvalidNumberOfValuesException if one of the following required params is missing:

```
$requiredParams = array (
    'id',
    'qty',
    'price'
);

```

It will also throw InvalidItemKeyException if an invalid update is passed to a cart item.

Notes
-----

[](#notes)

Using dd() to view cart contents will interrupt Laravels Session storage functions and can prevent the cart from being updated.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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

4287d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3694336?v=4)[Bob Kingstone](/maintainers/BobKingstone)[@BobKingstone](https://github.com/BobKingstone)

---

Top Contributors

[![BobKingstone](https://avatars.githubusercontent.com/u/3694336?v=4)](https://github.com/BobKingstone "BobKingstone (14 commits)")

---

Tags

laravelecommerceshopping cart

### Embed Badge

![Health badge](/badges/bobkingstone-pedlar-cart/health.svg)

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

###  Alternatives

[lukepolo/laracart

A simple cart for Laravel

583135.4k1](/packages/lukepolo-laracart)[jsdecena/laracom

Laravel powered e-commerce

2.0k4.4k](/packages/jsdecena-laracom)[amsgames/laravel-shop

Package set to provide shop or e-commerce functionality (such as CART, ORDERS, TRANSACTIONS and ITEMS) to Laravel for customizable builds.

4845.9k](/packages/amsgames-laravel-shop)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[realrashid/cart

Meet Cart — your ultimate solution for seamless shopping cart functionality in Laravel applications. Cart simplifies the complexities of shopping cart operations, from product additions to total calculations, ensuring a frictionless user experience.

1093.6k](/packages/realrashid-cart)[wearepixel/laravel-cart

A cart implementation for Laravel

1310.5k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

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