webazin/referral
Composer 安装命令:
composer require webazin/referral
包简介
A Referral system for Laravel application
README 文档
README
A Referral System With Laravel
Installation
Via Composer to add the package to your project's dependencies:
composer require "webazin/referral @dev"
migrations
php artisan migrate
Setup the model
Add ReferralTrait Trait to your User model.
use Webazin\Referral\ReferralTrait class User extends Model { use ReferralTrait; }
Params
App\User::find(1)->getRefLink(); App\User::find(1)->setParentId($referralCode); App\User::find(1)->getParent(); App\User::find(1)->setReferralCode(); // if this set --- set parent id App\User::find(1)->getReferralCodeFromCookie(); //relationships App\User::find(1)->parent; App\User::find(1)->child; App\User::find(1)->referralCount();
License
Licensed under the MIT license.
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-03