2017 © Pedro Peláez
 

library cart

Simple Session based cart for shopping websites

image

aharen/cart

Simple Session based cart for shopping websites

  • Saturday, August 13, 2016
  • by aharen
  • Repository
  • 1 Watchers
  • 0 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 10 % Grown

The README.md

Cart

Simple Session based cart for shopping websites in Laravel, (*1)

Installation

composer require aharen/cart

Configuration

  1. Add CartServiceProvider to providers in config/app.php, (*2)

    aharen\Cart\CartServiceProvider::class,, (*3)

  2. Add Cart Facade to aliases in config/app.php, (*4)

    'Cart' => aharen\Cart\CartFacade::class,, (*5)

  3. Publish the config file to config folder, (*6)

    php artisan vendor:publish, (*7)

If so some reason it doesn't create the config file you have to create a file named cart.php inside the config folder with the contents below, (*8)

<?php
return [
    'name' => 'yourcartnamehere',
];

Usage

Get items currently in cart

Get the current contents of the cart. Will return false if the cart is empty, (*9)

Cart::get();

Count items currently in cart

Cart::count();

Add item to cart

The first parameter is your item. It can either be an ID or item name. The second parameter has to be numeric which is the Quantity., (*10)

Cart::add('Pizza Slice', 2);

Remove Item from cart

Accepts only 1 parameter, which is your item ID or item name, (*11)

Cart::remove('Pizza Slice');

Reset the cart

Empties your current cart, (*12)

Cart::reset();

The Versions

13/08 2016

dev-master

9999999-dev

Simple Session based cart for shopping websites

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel cart shopping

13/08 2016

v1.0

1.0.0.0

Simple Session based cart for shopping websites

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Ahmed Khusaam

laravel cart shopping