PHPackages                             angel/products - 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. angel/products

ActiveLibrary

angel/products
==============

An Angel CMS module for products.

v1.0.5(10y ago)62423PHPPHP &gt;=5.3.0

Since Aug 12Pushed 10y ago6 watchersCompare

[ Source](https://github.com/JVMartin/angel-products)[ Packagist](https://packagist.org/packages/angel/products)[ Docs](https://github.com/JVMartin/angel-products)[ RSS](/packages/angel-products/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (15)Used By (0)

Angel Products
==============

[](#angel-products)

This is an eCommerce module for the [Laravel 4 Angel CMS](https://github.com/JVMartin/angel).

The module works with Stripe out of the box, but you can easily extend it to use other payment gateways.

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

[](#installation)

Add the following requirements to your `composer.json` file:

```
"require": {
	...
	"angel/products": "1.0.*"
},
```

Issue a `composer update` to install the package.

Add the following service provider to your `providers` array in `app/config/app.php`:

```
'Angel\Products\ProductsServiceProvider'
```

Issue the following commands:

```
php artisan migrate --package="angel/products"   # Run the migrations
php artisan asset:publish                        # Publish the assets
php artisan config:publish angel/products        # Publish the config
```

Open up your `app/config/packages/angel/core/config.php` and add the products and orders routes to the `menu` array:

```
'menu' => array(
	'Pages'     => 'pages',
	'Menus'     => 'menus',
	'Products'  => 'products', //  'orders',   //  'users',
	'Settings'  => 'settings'
),
```

...and the menu-linkable models to the `linkable_models` array:

```
'linkable_models' => array(
	'Page'             => 'pages',
	'Product'          => 'products',           //  'products/categories' //  array(
	'test' => array(
		'secret'      => 'xxxxxxxxxxxxxx',
		'publishable' => 'xxxxxxxxxxxxxx'
	),
	'live' => array(
		'secret'      => 'xxxxxxxxxxxxxx',
		'publishable' => 'xxxxxxxxxxxxxx'
	)
)
```

Cart Usage
----------

[](#cart-usage)

[The cart class](https://github.com/JVMartin/angel-products/blob/master/src/Angel/Products/Cart.php) stores variations of products, based on their selected options, in the session.

### Add Products

[](#add-products)

```
$Product = App::make('Product');
$Cart    = App::make('Cart');

// Grab the user's desired product from the database.
$product = $Product::with('options')->findOrFail(Input::get('product_id'));

// Mark the selected option items by their IDs.
$product->markSelectedOptions(Input::get('options'));

// Add the product to the cart in the user's desired quantity, saving the unique key for accessing it later.
$key = $Cart->add($product, Input::get('quantity'));
```

### Add Products with Custom Options

[](#add-products-with-custom-options)

```
$Product = App::make('Product');
$Cart    = App::make('Cart');

// Grab the user's desired product from the database.
$product = $Product::findOrFail(Input::get('product_id'));

$product->addCustomOptions(array(
	'Size' => array(
		'name'  => 'Large',
		'price' => 4.50
	),
	'Color' => array(
		'name'  => 'Green',
		'price' => -2.50,
		'image' => 'assets/images/green-shirt.jpg'
	)
));

// Add the product to the cart in the user's desired quantity, saving the unique key for accessing it later.
$key = $Cart->add($product, Input::get('quantity'));
```

### Retrieve Key

[](#retrieve-key)

If you need to get the key for a product (i.e. to remove that product from the cart) you can do so like this:

```
// Retrieve the key.
$key = $Cart->key($product);

// Use the key however you wish.
$Cart->remove($key);
```

### Remove Products

[](#remove-products)

```
$Cart->remove($key);
```

### Adjust the Quantity of Products

[](#adjust-the-quantity-of-products)

```
$Cart->quantity($key, 5);
```

### Retrieve Products

[](#retrieve-products)

```
$details = $Cart->get($key);

// $details then looks like this:
array(
	'product' => {String, JSON encoded product},
	'price'   => {Float, price per unit},
	'qty'     => {Int, quantity of units}
);
```

### Loop Through Products

[](#loop-through-products)

```
foreach (Session::get('cart') as $key=>$details) {
	$product = json_decode($details['product']);
	$price   = $details['price'];
	$qty     = $details['qty'];
	$total   = $Cart->totalForKey($key);
}
```

### Get Totals

[](#get-totals)

```
// The total for all products in the cart.
echo $Cart->total();

// The total for a specific product variation by key.
echo $Cart->totalForKey($key);

// The total number of items in the cart.  (Variations x their quantity)
echo $Cart->count();
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Recently: every ~66 days

Total

13

Last Release

3952d ago

Major Versions

0.0.4.x-dev → 1.0.0.x-dev2014-09-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/54fb866ad5ba7f84906f769722246119b3531a5856ecf521aedccadfe4a5bd59?d=identicon)[JVMartin](/maintainers/JVMartin)

---

Top Contributors

[![JVMartin](https://avatars.githubusercontent.com/u/4450814?v=4)](https://github.com/JVMartin "JVMartin (60 commits)")

---

Tags

laravelcmscartproductscommerceangel

### Embed Badge

![Health badge](/badges/angel-products/health.svg)

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

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[lukepolo/laracart

A simple cart for Laravel

583135.4k1](/packages/lukepolo-laracart)[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6272.7k4](/packages/riclep-laravel-storyblok)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[sunnysideup/ecommerce

Silverstripe E-commerce Application

257.2k79](/packages/sunnysideup-ecommerce)[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)
