nu1ww/loyalty
Composer 安装命令:
composer require nu1ww/loyalty
包简介
Total loyalty management module
README 文档
README
Loyalty system for laravel 5 +
Installation
First, pull in the package through Composer.
composer require nu1ww/loyalty
And then include the service provider within app/config/app.php.
'providers' => [ Loyalty\LoyaltyServiceProvider::class ];
At last you need to publish and run the migration.
php artisan vendor:publish --provider="Loyalty\LoyaltyServiceProvider" && php artisan migrate
Setup a Model
<?php namespace App; use Loyalty\Contracts\Loyalty; use Loyalty\Traits\LoyaltyTrait as LoyaltyTrait; use Illuminate\Database\Eloquent\Model; class User extends Model implements Loyalty { use LoyaltyTrait; }
Earn Points
$user = \App\User::first(); $amount = 10; $message = ""; $data = []; $transaction = $user->earnPoints($amount, $message, $data);
Burn Points
You can give negative and positive values
$user = \App\User::first(); $amount = 10; $message = ""; $data = []; $transaction = $user->burnPoints($amount, $message, $data);
Get Available Points by User
$point;
Count Transactions
$point;
Paginated data list
$point;
Tiger notification
$point;
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-27