定制 eldegweydev/coupon 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱: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
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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