承接 icekristal/laravel-interior-multi-wallet 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

icekristal/laravel-interior-multi-wallet

最新稳定版本:v6.2.1

Composer 安装命令:

composer require icekristal/laravel-interior-multi-wallet

包简介

Laravel multi wallet

README 文档

README

install:

composer require icekristal/laravel-interior-multi-wallet

migration:

php artisan vendor:publish --provider="Icekristal\LaravelInteriorMultiWallet\IceInteriorMultiWalletServiceProvider" --tag="migrations"

config:

php artisan vendor:publish --provider="Icekristal\LaravelInteriorMultiWallet\IceInteriorMultiWalletServiceProvider" --tag="config"

lang:

php artisan vendor:publish --provider="Icekristal\LaravelInteriorMultiWallet\IceInteriorMultiWalletServiceProvider" --tag="translations"

enums:

php artisan vendor:publish --provider="Icekristal\LaravelInteriorMultiWallet\IceInteriorMultiWalletServiceProvider" --tag="enums"

use:

use Icekristal\LaravelInteriorMultiWallet\InteractsWithMultiWallet;

class User extends Model
{
    use InteractsWithMultiWallet;
}

get balance user:

$balanceDefaultCurrency = $modelUser->balance();
$balanceOtherCurrency = $modelUser->balance('key_other_currency'); //default balanceType = main
$balanceOtherCurrencyAndTypeBalance = $modelUser->balance('key_currency', 'demo'); //default balanceType = main

set debit balance:

$modelUser->debitBalance($amount, 'key_type'); //Debit default currency
$modelUser->debitBalance($amount, 'key_type', 'key_other_currency'); //Debit other currency
$modelUser->debitBalance($amount, 'key_type', 'key_currency', 'type_balance'); //Debit other type_balance, see config im_wallet

set credit balance:

$modelUser->creditBalance($amount, 'key_type'); //Credit default currency
$modelUser->creditBalance($amount, 'key_type', 'key_other_currency'); //Credit other currency
$modelUser->creditBalance($amount, 'key_type', 'key_currency', 'type_balance'); //Credit other type_balance, see config im_wallet

see transaction user

$modelUser->balanceTransaction()->get(); //All transaction
$modelUser->balanceTransaction($codeCurrency, $balanceType)->get(); //All transaction only codeCurrency and balanceType

block/unblock transaction user

$modelUser->blockTransaction($typeCredit, $codeCurrency, $balanceType); //Block transaction all params (permanent)
$modelUser->blockTransaction($typeCredit, $codeCurrency); //Block transaction only typeCredit and codeCurrency
$modelUser->blockTransaction(null, $codeCurrency, $balanceType); //Block transaction only codeCurrency and balanceType

$modelUser->unblockTransaction($typeCredit, $codeCurrency, $balanceType); //Unblock transaction all params
$modelUser->unblockTransaction($typeCredit, null, $balanceType); //Unblock only typeCredit and balanceType
$modelUser->unblockTransaction($typeCredit, $codeCurrency); //Unblock only typeCredit and codeCurrency

Facade Action

ImWallet::setOwner($owner)
        ->setType($typeCredit)
        ->setCurrency($codeCurrency)
        ->setBalanceType($balanceType)
        ->setAmount($amount)
        ->setWho($who)
        ->setOther($otherInfo)
        ->executeTransaction();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-18