定制 tomatophp/filament-wallet 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

tomatophp/filament-wallet

最新稳定版本:4.0.0

Composer 安装命令:

composer require tomatophp/filament-wallet

包简介

Account Balance / Wallets Manager For FilamentPHP and Filament Account Builder

README 文档

README

Screenshot

Filament Wallet

Latest Stable Version License Downloads Dependabot Updates PHP Code Styling Tests

Account Balance / Wallets Manager For FilamentPHP and Filament Account Builder

you can get more details about how to use this package in Bavix Wallet

Screenshots

Account Wallet Charge A Wallet Wallets List Transactions List

Installation

composer require tomatophp/filament-wallet

after installing your package, please run this command

php artisan filament-wallet:install

finally register the plugin on /app/Providers/Filament/AdminPanelProvider.php

->plugin(\TomatoPHP\FilamentWallet\FilamentWalletPlugin::make())

Usage

to add a wallet to your user model on your model add this trait

namespace  App\Models;

use Bavix\Wallet\Interfaces\Wallet;
use Bavix\Wallet\Traits\HasWalletFloat;

class Account extends Model implements Wallet
{
    use HasWalletFloat;
}

now your model is having a wallet on your resource add this action to your table

use TomatoPHP\FilamentWallet\Filament\Actions\WalletAction;

public function table(Table $table): void
{
    $table->actions([
        WalletAction::make('wallet'),
    ]);
}

now yo can charge the wallet of the user by clicking on the wallet action

Integration With Filament Accounts

first you need to install Filament Account Builder

composer require tomatophp/filament-account

then you need to publish the model file

php artisan vendor:publish --tag="filament-accounts-model"

then you can use this model in your project and attach this traits to your model

namespace  App\Models;

use Bavix\Wallet\Interfaces\Wallet;
use Bavix\Wallet\Traits\HasWalletFloat;

class Account extends Model implements Wallet
{
    use HasWalletFloat;
}

now your accounts have a balance ready.

finally, register the plugin on /app/Providers/Filament/AdminPanelProvider.php

->plugin(\TomatoPHP\FilamentWallet\FilamentWalletPlugin::make()->useAccounts())

Testing

if you like to run PEST testing just use this command

composer test

Code Style

if you like to fix the code style just use this command

composer format

PHPStan

if you like to check the code by PHPStan just use this command

composer analyse

Other Filament Packages

Checkout our Awesome TomatoPHP

统计信息

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

GitHub 信息

  • Stars: 33
  • Watchers: 1
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-18