aharen/cart 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aharen/cart

Composer 安装命令:

composer require aharen/cart

包简介

Simple Session based cart for shopping websites

README 文档

README

Simple Session based cart for shopping websites in Laravel

Installation

composer require aharen/cart

Configuration

  1. Add CartServiceProvider to providers in config/app.php

    aharen\Cart\CartServiceProvider::class,

  2. Add Cart Facade to aliases in config/app.php

    'Cart' => aharen\Cart\CartFacade::class,

  3. Publish the config file to config folder

    php artisan vendor:publish

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

<?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

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.

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

Remove Item from cart

Accepts only 1 parameter, which is your item ID or item name

Cart::remove('Pizza Slice');

Reset the cart

Empties your current cart

Cart::reset();

统计信息

  • 总下载量: 58
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-08-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固