PHPackages                             unodepiera/simplecart - 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. unodepiera/simplecart

ActiveLibrary[Framework](/categories/framework)

unodepiera/simplecart
=====================

Simplecart for Laravel 4

63793PHP

Since Feb 13Pushed 12y ago2 watchersCompare

[ Source](https://github.com/uno-de-piera/simplecart)[ Packagist](https://packagist.org/packages/unodepiera/simplecart)[ RSS](/packages/unodepiera-simplecart/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Simple Cart for Laravel 4
=========================

[](#simple-cart-for-laravel-4)

Installation
============

[](#installation)

Open your composer.json and add the next code

```json { "require": { "laravel/framework": "4.0.\*", "unodepiera/simplecart": "dev-master" }, "minimum-stability": "dev" } ``` Update your packages with composer update or install with composer install.

Usage
=====

[](#usage)

Find the providers key in app/config/app.php and register the Simplecart Service Provider.

```json 'providers' =&gt; array( //... 'Unodepiera\\Simplecart\\SimplecartServiceProvider' ) ``` Find the aliases key in app/config/app.php.

```json 'aliases' =&gt; array( //... 'Simplecart' =&gt; 'Unodepiera\\Simplecart\\Facades\\Simplecart', ) ``` Example Usage Simplecart
========================

[](#example-usage-simplecart)

Insert simple row
-----------------

[](#insert-simple-row)

```php $id = 19; $qty = 20; $price = 550; $item = array( 'id' =&gt; 5, 'qty' =&gt; $qty, 'price' =&gt; $price, 'name' =&gt; "hair", 'medida' =&gt; "xl" ); ```
//add options to row
$item["options"] = array("color" => "blue", "avaliable" => "si");

//add row to cart
Simplecart::insert($item);

```

```
Update a product
```php
	$update = array(
    	'id' => 5,
        'rowid'	=> "e4da3b7fbbce2345d7772b0674a318d5",
        'qty' => 25,
        'price' => $price,
        'name' => "shirt",
        'medida' => "xl"
    );

    Simplecart::update($update);

```

### Remove a product by rowid

[](#remove-a-product-by-rowid)

You just need to pass a rowid that there

```php Simplecart::remove\_item("8e296a067a37563370ded05f5a3bf3ec"); ``` ### Get cart content

[](#get-cart-content)

```php Simplecart::get\_content(); ``` ### Get total cost

[](#get-total-cost)

```php Simplecart::total\_cart(); ``` ### Get total items

[](#get-total-items)

```php Simplecart::total\_articles(); ``` ### Destroy simplecart

[](#destroy-simplecart)

```php Simplecart::destroy(); ``` Final example usage
===================

[](#final-example-usage)

First visit route insert

```php Route::get("insert", function(){ $id = 9; $qty = 5; $price = 1500; $item = array( 'id' =&gt; $id, 'qty' =&gt; $qty, 'price' =&gt; $price, 'name' =&gt; "shirt", 'medida' =&gt; "xxl" ); ```
//add options to row
$item["options"] = array("color" => "orange", "avaliable" => "yes");

//add row to cart
Simplecart::insert($item);

```

});

```
Then create the next view and visit the route show
```php
Route::get("show", function()
{
	$cart = Simplecart::get_content();
	$totalcart = Simplecart::total_cart();
	$totalitems = Simplecart::total_articles();
	return View::make("cart", array("cart" => $cart, "total_cart" => $totalcart, "total_items" => $totalitems));
});

```

Loop the cart and check if has options
======================================

[](#loop-the-cart-and-check-if-has-options)

```html &lt;title&gt;Simplecart for Laravel 4&lt;/title&gt; @if($cart) @foreach($cart as $items) @endforeach     Id   Name   Options   Price   Qty  Total price     {{ $items\['id'\] }}   {{ $items\['name'\] }}   @if(isset($items\['options'\])) @foreach($items\['options'\] as $key =&gt; $val) {{ $key }}: {{ $val }} @endforeach @else ---- @endif   {{ $items\['price'\] }}   {{ $items\['qty'\] }}   {{ $items\['total'\] }}    Total: {{ $total\_cart }} Items: {{ $total\_items }}  @endif ``` ## Visit me - [Visit me](http://uno-de-piera.com)
- [SimpleCart on Packagist](https://packagist.org/packages/unodepiera/simplecart)
- [License](http://www.opensource.org/licenses/mit-license.php)
- [Laravel website](http://laravel.com)-

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/869a644a1fba01392533fea7c25eadde27caa339a7b6cd71e4e4ef18f2351f49?d=identicon)[unodepiera](/maintainers/unodepiera)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/unodepiera-simplecart/health.svg)

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M836](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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