定制 moirei/laravel-vouchers 二次开发

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

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

moirei/laravel-vouchers

Composer 安装命令:

composer require moirei/laravel-vouchers

包简介

Manage ecommerce vouchers

README 文档

README

An ecommerce voucher generator. It associates vouchers with one or more eloquent model and allows multiple models to own/redeem vouchers.

✔️ Requirements

  • Laravel ^8
  • PHP ^8.1

Documentation

All documentation is available at the documentation site.

💚 Unique Features

  • Associate one voucher with one or more items
  • Flexible redeemer models: vouchers can be redeemed by any model. User, Admin, Guest models.
  • Flexible voucher models: voucher can be associated with any model. Product, Variant, Ticket, whatever else.
  • Use vouchers once or multiple times
  • Limit access: can define model instances that are allowed or excluded from redeeming a Voucher
  • Multiple limit scheme; exhaust redeems per instance, per user or per product

Example usage:

$product = Product::find(1);
$voucher = $product->createVoucher();

$user->redeem($voucher);

Installation

You can install the package via composer:

composer require moirei/laravel-vouchers

Next publish the migration with

php artisan vendor:publish --tag="vouchers-migrations"

Then run the migrations:

php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="vouchers-config"

Notes

  • The allow_models and deny_models attributes mentioned above are actually saved as can_redeem and cannot_redeem internally. They are mutated on boot creating or updating.
  • If you manage your resources with Nova, Nova Multiselect can be used directly with the can_redeem and cannot_redeem attributes. Example code here.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固