laraveleg/laravel-user-wallet 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

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 depositing and withdrawal

THX.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-10-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固