【文件属性】:
文件名称:laravel-vouchers:允许用户兑换绑定到模型的凭证
文件大小:18KB
文件格式:ZIP
更新时间:2021-04-30 08:46:20
PHP
Laravel代金券 :admission_tickets:
该软件包可以将凭证与您的Eloquent模型相关联。 如果您需要将凭证代码与Eloquent模型中存储的内容相关联,这可能会派上用场。
以下是如何创建和兑换凭证的示例:
$ videoCourse = VideoCourse :: find ( 1 );
$ voucher = $ videoCourse -> createVoucher ();
auth ()-> user ()-> redeemVoucher ( $ voucher );
安装
您可以通过composer安装该软件包:
composer require beyondcode/laravel-vouchers
软件包将自动注册。
您可以使用以下方法发布迁移:
php artisan vendor:publish --provider= " BeyondCode\Vouchers\V
【文件预览】:
laravel-vouchers-master
----src()
--------Exceptions()
--------VoucherGenerator.php(2KB)
--------VouchersServiceProvider.php(2KB)
--------Events()
--------Vouchers.php(2KB)
--------Facades()
--------Traits()
--------Models()
--------Rules()
----LICENSE.md(1KB)
----.styleci.yml(66B)
----CONTRIBUTING.md(3KB)
----composer.json(1KB)
----CHANGELOG.md(129B)
----translations()
--------en()
----.github()
--------workflows()
----README.md(7KB)
----config()
--------.gitkeep(0B)
--------config.php(1KB)
----database()
--------migrations()