berkayk/laravel-cart 问题修复 & 功能扩展

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

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

berkayk/laravel-cart

Composer 安装命令:

composer require berkayk/laravel-cart

包简介

Laravel shopping cart management in an easy way.

README 文档

README

Latest Stable Version Total Downloads License

Cart Manager for Laravel 5.5+

This package is an updated version of FreshBitsWeb's laravel-cart-manager package.

What's updated

  • Each update to a cart item's quantity now dispatches CartItemQuantityChanged event.

Just another shopping cart package?

There are a few well maintained shopping cart packages available but I wanted to have a solution which feels like the Laravel way and is more coupled with the database and provides additional functionality like shipping charges, discount, tax, total, round off, guest carts, etc. out-of-box while staying a very easy to use package.

Why/when to use?

Let us decide when this package should be used:

  1. You are looking for an easy to use solution which provides cart feature for users as well as guests.
  2. You want to make sure that the carting can work via APIs as well to support mobile applications.
  3. You want features like Shipping charges, tax, discount, round off, etc.
  4. You want to store cart data in Database, session or at a custom place.
  5. You like using the packages which are more like the Laravel way

Installation

  1. Install the package by running this command in your terminal/cmd:
composer require freshbitsweb/laravel-cart-manager
  1. Import config file by running this command in your terminal/cmd:
php artisan vendor:publish --tag=laravel-cart-manager-config
  1. Import migrations files by running these commands in your terminal/cmd:
php artisan vendor:publish --tag=laravel-cart-manager-migrations
php artisan migrate
  1. Add a trait to the model(s) of cart items:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Freshbitsweb\LaravelCartManager\Traits\Cartable;

class Product extends Model
{
    use Cartable;
    // ...
}

Usage - As Easy as 1 2 3

// Add to cart
$cart = Product::addToCart($productId);

// Remove from cart
$cart = cart()->removeAt($cartItemIndex);

// Apply discount
$cart = cart()->applyDiscount($percentage);

// Fetch cart
$cart = cart()->toArray();

Online Demo

The demo of the package can be found at - https://laravel-cart-manager.freshbits.in

Detailed Documentation

Checkout the full documentation.

Tests

Run this command to run the tests of the package:

composer test

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Special Thanks to

berkayk/laravel-cart 适用场景与选型建议

berkayk/laravel-cart 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 11 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 berkayk/laravel-cart 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 berkayk/laravel-cart 我们能提供哪些服务?
定制开发 / 二次开发

基于 berkayk/laravel-cart 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 33
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-10