laraveleg/laravel-user-wallet
Composer 安装命令:
composer require laraveleg/laravel-user-wallet
包简介
Create a cash wallet for the user that can deposit and withdraw
README 文档
README
Create a cash wallet for the user that can deposit and withdraw.
Requirements
- php ^7.0
- laravel/framework ^7.0 OR ^8.0
Install via composer
Add orm to composer.json configuration file.
$ composer require laraveleg/laravel-user-wallet
Migrate
$ php artisan migrate
add the trait in your model User in app/Models/User.php file
use LaravelEG\UserWallet\Traits\UserWalletTrait; class User extends Authenticatable { use UserWalletTrait; ...
Functions
depositBalance
To deposit into a user's wallet.
Auth::user()->depositBalance(100, '<details>');
withdrawalBalance
For withdrawal from the user's wallet.
Auth::user()->withdrawalBalance(50, '<details>');
Attributes
balance
Fetch user balance.
Auth::user()->balance;
Listeners
Publish vendor
- Run
php artisan vendor:publish - Selection
LaravelEG\UserWallet\UserWalletServiceProvider
Config file
Go to config/laraveleg/userwallet.php
- You can set listeners classes if when
depositingandwithdrawal
THX.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2020-10-04