Download the PHP package anam/lara-phpcart without Composer
On this page you can find all versions of the php package anam/lara-phpcart. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download anam/lara-phpcart
More information about anam/lara-phpcart
Files in anam/lara-phpcart
Package lara-phpcart
Short Description Laravel php shopping cart
License MIT
Homepage https://github.com/anam-hossain/lara-phpcart
Informations about the package lara-phpcart
Lara-PHPCart
Laravel PHP shopping cart
Features
- Simple API
- Support multiple cart instances
Requirements
- Laravel 5+
Installation
Lara-phpcart is available via Composer
Integrations
Laravel 5.5+ integrations
Package Discovery
anam/lara-phpcart
utilize the Laravel's package auto discovery feature. So, you don't need to add manually Service provider and Facade in Laravel application's config/app.php. Laravel will automatically register the service provider and facades for you.
Laravel < 5.5 integrations
After you have installed the Laravel-PHPCart, open the config/app.php file which is included with Laravel and add the following lines.
In the $providers array add the following service provider.
Add the facade of this package to the $aliases array.
You can now use this facade in place of instantiating the Cart yourself in the following examples.
Usage
Add Item
The add method required id
, name
, price
and quantity
keys. However, you can pass any data that your application required.
Update Item
Update quantity
Update price
Remove an Item
Get all Items
Get an Item
Determining if an Item exists in the cart
Get the total number of items in the cart
Get the total quantities of items in the cart
Total sum
Empty the cart
Multiple carts
Lara-PHPCart supports multiple cart instances, so that you can have as many shopping cart instances on the same page as you want without any conflicts.