New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

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 advised

Not 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

dilab/cart

Shopping Cart Library

2,453 6
darryldecode/cart

Laravel 5 Shopping cart

2,063,750 1,400
diegonella/cart

Laravel 5 Shopping cart

1,478 0
viviniko/cart

VIVINIKO Cart Service Provider

158 0
aharen/cart

Simple Session based cart for shopping websites

58 0

Version History

Version Released Laravel License
v1.0.8 5.0.*|5.1.* MIT
v1.0.7 5.0.*|5.1.* MIT
v1.0.6 5.0.*|5.1.* MIT
v1.0.5 5.0.*|5.1.* MIT
v1.0.4 5.0.*|5.1.* MIT