Package Data | |
---|---|
Maintainer Username: | rayjun |
Maintainer Contact: | rayjun0412@gmail.com (rayjun) |
Package Create Date: | 2015-07-23 |
Package Last Update: | 2015-07-29 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-10-30 15:08:29 |
Package Statistics | |
---|---|
Total Downloads: | 25 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
laravel 框架购物车组件
可以直接在命令行安装:
composer require "rayjun/laravel-cart:1.0.*"
或者可以在你项目的 composer.json
"require": {
"rayjun/laravel-cart": "1.0.*"
}
然后执行:
composer update
在完成上面的步骤之后,可以在 config/app.php
的 providers
数组中增加以下的代码:
'Rayjun\LaravelCart\LaravelCartServiceProvider'
然后增加下面一行到 aliases
:
'Cart' => 'Rayjun\LaravelCart\Facades\Cart',
Cart Cart::cart(int $user_id);
CartItem Cart::add(int $cart_id, int $good_id, int $count, float $price, string color, string size);
CartItem Cart::updateItem(int $item_id, array $attributes);
CartItem Cart::updateQty(int $item_id, int $qty);
Collection Cart::getAllItems(int $cart_id);
CartItem Cart::getItem(int $item_id);
boolean Cart::removeItem(int $item_id);
boolean Cart::removeAllItem(int $cart_id);
float Cart::totalPrice(int $cart_id);
int Cart::count(int $cart_id);