eldegweydev/coupon 问题修复 & 功能扩展

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

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

eldegweydev/coupon

Composer 安装命令:

composer require eldegweydev/coupon

包简介

Coupon CRUD Package For Laravel

README 文档

README

This package help you to generate the CRUD for coupon codes and easily apply the coupons and verify it. It offer different types of discounts, Fixed and Percentage discounts.

Installation

First, install Package into your project using the Composer package manager:

composer require eldegweydev/coupon

Run migrations

Finally, run database migration

php artisan migrate

Routes List

Can access the coupons routes from this table

Method Action URI
GET index /coupons
GET show /coupons/{coupon}
GET create coupons/create
POST store /coupons
GET edit /coupons/{coupon}/edit
PUT update /coupons/{coupon}
DELETE destroy /coupons/{coupon}

Usage

To verify coupon code and apply the discount , you can use the provided Trait Coupon, it has two functions one for check the coupon is active and second to apply the coupon discount

use Eldegweydev\Coupon\Http\Traits\CouponTrait

use CouponTrait;

$this->checkCouponIsActive($code,$select = ['*']);

$this->calculateCouponDiscount($code,$total_price);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-04-24