tomatophp/filament-wallet
Filament Wallet adds wallet/balance management to FilamentPHP using bavix/laravel-wallet. Install the plugin, add the wallet trait to your model, then manage wallets, charges, and transactions from Filament resources with ready-made pages/actions.
Architecture Fit
The package is optimized for FilamentPHP v4, leveraging its Livewire-based architecture to provide real-time wallet interactions (e.g., balance updates, transaction logs). The shift from live() to lazy() improves UI responsiveness by deferring updates until user input is complete, aligning with modern Filament best practices. However, this introduces tight coupling with Filament’s v4 ecosystem, which may limit flexibility for teams using custom UI layers or non-Livewire frontends. The underlying bavix/laravel-wallet dependency ensures robust wallet operations (e.g., float precision, transaction history), but the package itself focuses on admin-facing UI, not public APIs or complex financial logic.
Integration Feasibility
FilamentWalletPlugin abstracts wallet management into a reusable component, reducing boilerplate.live() → lazy(), Filament v4 dependencies). Requires either a full migration or custom polyfills.useAccounts() method simplifies integration for projects using tomatophp/filament-account, but this is optional.Technical Risk
lazy() update may introduce UX friction if users expect immediate feedback (e.g., balance updates after a deposit). Requires user testing.bavix/laravel-wallet (v11+) and Filament v4, which may conflict with existing Laravel versions or packages (e.g., older Livewire versions).Key Questions
lazy() behavior meet performance needs (e.g., for trading platforms where latency matters)?Stack Fit
filament-account: The useAccounts() method streamlines wallet integration for user profiles.Migration Path
filament/filament, bavix/laravel-wallet).composer require tomatophp/filament-wallet.php artisan filament-wallet:install.AdminPanelProvider.php with FilamentWalletPlugin::make().HasWalletFloat trait and Wallet interface to target models (e.g., User, Account).filament-account (php artisan vendor:publish --tag="filament-accounts-model").WalletAction to Filament resources for table-based wallet management.resources/views/filament-wallet/...) if default UI is insufficient.composer test.lazy() behavior in staging for UX issues (e.g., delayed updates).Compatibility
| Component | Compatibility Notes |
|---|---|
| Laravel | Tested with Laravel 10+. May require adjustments for Laravel 9 or older. |
| Filament | v4 only. v3 users must upgrade or use a fork. |
| Livewire | Assumes Livewire 3+. Older versions may break lazy() functionality. |
| Database | No schema changes, but assumes bavix/laravel-wallet migrations are applied. |
| Filament Plugins | Designed for Filament’s plugin system; may conflict with custom plugins. |
Sequencing
lazy() behavior with power users (e.g., admins processing high-value transactions).Maintenance
bavix/laravel-wallet docs for advanced use cases.Support
bavix/laravel-wallet directly for unsupported features.Scaling
lazy() may introduce latency for high-frequency operations (e.g., 100+ TPS).float precision; large balances may require decimal adjustments.lazy() under concurrent loads.Failure Modes
| Scenario | Impact | Mitigation Strategy |
|---|---|---|
| Filament v4 Breaking Change | Plugin breaks without notice. | Monitor Filament release notes; use feature flags for critical wallet actions. |
| Race Conditions | Double-charged wallets. | Implement database transactions or optimistic locking for wallet updates. |
| UI Freezes | lazy() delays block workflows. |
Add loading indicators; adjust lazy() thresholds or use live() as a fallback. |
| Database Corruption |
How can I help you explore Laravel packages today?