rayjun/laravel-cart
Cart for Laravel Application.
26
4
Larablocks Analysis
rayjun/laravel-cart works with Laravel 5 (latest release v1.0.8, Jul 28, 2015), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Jul 28, 2015)
- 0 downloads a month (needs 10,000)
- 4 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Jul 28, 2015.
- No releases in the last 12 months.
- First released: Jul 25, 2015.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 26, 2026.
| Install | |
|---|---|
composer require rayjun/laravel-cart |
|
| Latest Version: | v1.0.8 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Jul 29, 2015 |
| Links: | GitHub · Packagist |
Maintainer: rayjun
laravel-cart
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);
Related Packages
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| v1.0.8 | 5.0.*| | MIT | |
| v1.0.7 | 5.0.*| | MIT | |
| v1.0.6 | 5.0.*| | MIT | |
| v1.0.5 | 5.0.*| | MIT | |
| v1.0.4 | 5.0.*| | MIT | |
| v1.0.3 | 5.0.*| | MIT | |
| v1.0.2 | 5.0.*| | MIT | |
| v1.0.1 | 5.0.*| | MIT | |
| v1.0 | 5.0.*| | MIT |