Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Wallet Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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

  • Filament v4 Projects: Seamless integration with minimal effort (installation + plugin registration). The FilamentWalletPlugin abstracts wallet management into a reusable component, reducing boilerplate.
  • Filament v3 Projects: High risk due to breaking changes (e.g., live()lazy(), Filament v4 dependencies). Requires either a full migration or custom polyfills.
  • Non-Filament Projects: Limited utility unless the team adopts Filament v4 for admin panels. The package is not a standalone wallet solution—it relies on Filament’s infrastructure.
  • Filament Account Builder: Native support via the useAccounts() method simplifies integration for projects using tomatophp/filament-account, but this is optional.

Technical Risk

  • Breaking Changes: The lazy() update may introduce UX friction if users expect immediate feedback (e.g., balance updates after a deposit). Requires user testing.
  • Dependency Bloat: Pulls in bavix/laravel-wallet (v11+) and Filament v4, which may conflict with existing Laravel versions or packages (e.g., older Livewire versions).
  • Testing Gaps: While the package includes a test suite, it may not cover edge cases like:
    • Concurrent wallet operations (e.g., race conditions in high-volume systems).
    • Custom validation rules or business logic layered on top of the wallet.
  • Scalability: No documented limits on wallet size or transaction throughput. Critical for SaaS/marketplace use cases with millions of transactions.

Key Questions

  1. Filament Ecosystem Lock-in: Is the team committed to Filament v4 long-term, or could this package become a migration bottleneck?
  2. Real-Time Requirements: Will the lazy() behavior meet performance needs (e.g., for trading platforms where latency matters)?
  3. Wallet Extensibility: Does the package support custom transaction types (e.g., refunds, fees) or third-party payment gateways?
  4. Audit/Compliance: Are there regulatory requirements (e.g., GDPR, PCI) that necessitate additional logging or access controls beyond what the package provides?
  5. Multi-Tenancy: How does the package handle isolated wallets for tenants in multi-tenant applications (e.g., SaaS)?
  6. Fallback Strategy: What’s the plan if Filament v4 introduces breaking changes post-adoption (e.g., API deprecations)?

Integration Approach

Stack Fit

  • Best For:
    • Filament v4 Admin Panels: Ideal for managing user balances, subscriptions, or marketplace credits (e.g., Airbnb-style payouts, SaaS metered billing).
    • Livewire-Heavy Applications: Leverages Filament’s Livewire integration for dynamic updates without full-page reloads.
    • Projects Using filament-account: The useAccounts() method streamlines wallet integration for user profiles.
  • Poor Fit:
    • Filament v3 or Earlier: Requires significant refactoring or feature flags.
    • Headless APIs: The package is UI-focused; wallet logic would still need a separate API layer.
    • Non-Laravel Stacks: PHP/Laravel dependency is mandatory.

Migration Path

  1. Pre-Integration:
    • Audit Dependencies: Ensure compatibility with Laravel 10+ and Livewire 3+. Resolve conflicts (e.g., filament/filament, bavix/laravel-wallet).
    • Backup Wallet Logic: Document existing wallet flows (e.g., custom transactions, notifications) to identify gaps post-integration.
  2. Installation:
    • Composer: composer require tomatophp/filament-wallet.
    • Artisan: php artisan filament-wallet:install.
    • Register Plugin: Update AdminPanelProvider.php with FilamentWalletPlugin::make().
  3. Model Integration:
    • Add HasWalletFloat trait and Wallet interface to target models (e.g., User, Account).
    • Publish Filament Account model if using filament-account (php artisan vendor:publish --tag="filament-accounts-model").
  4. UI Integration:
    • Add WalletAction to Filament resources for table-based wallet management.
    • Customize wallet views (e.g., resources/views/filament-wallet/...) if default UI is insufficient.
  5. Post-Integration:
    • Run tests: composer test.
    • Monitor 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

  1. Phase 1: Core Integration (1–2 weeks):
    • Install package, register plugin, and integrate wallet trait into primary models.
    • Test basic CRUD operations (e.g., charging wallets, viewing transactions).
  2. Phase 2: UI/UX Validation (1 week):
    • Validate lazy() behavior with power users (e.g., admins processing high-value transactions).
    • Adjust thresholds or add loading states if delays are noticeable.
  3. Phase 3: Advanced Features (Ongoing):
    • Extend wallet logic (e.g., custom transaction types, webhooks).
    • Integrate with payment gateways or third-party services.
  4. Phase 4: Scaling (As needed):
    • Optimize for high-volume wallets (e.g., caching, database indexing).
    • Implement multi-tenancy if required.

Operational Impact

Maintenance

  • Pros:
    • MIT License: No vendor lock-in; can fork or modify as needed.
    • Active Development: Recent releases (2025) and CI/CD pipelines suggest ongoing support.
    • Test Suite: Reduces regression risk for core wallet operations (e.g., deposits, withdrawals).
  • Cons:
    • Filament Dependency: Maintenance tied to Filament v4’s roadmap (e.g., Livewire updates, Blade changes).
    • Limited Documentation: Relies heavily on bavix/laravel-wallet docs for advanced use cases.
    • Community Support: Small community (37 stars) may limit troubleshooting for niche issues.

Support

  • Primary Support Channels:
    • GitHub Issues: Response time varies (low activity suggests slower support).
    • Filament Discord: Likely faster for Filament-specific questions.
  • Workarounds:
    • Extend the package via Filament’s service providers or custom actions.
    • Use bavix/laravel-wallet directly for unsupported features.
  • SLAs: None defined; assume self-service or community-driven fixes.

Scaling

  • Performance:
    • Transactions: No documented limits, but lazy() may introduce latency for high-frequency operations (e.g., 100+ TPS).
    • Database: Wallets use float precision; large balances may require decimal adjustments.
    • Caching: Not built-in; teams must implement (e.g., Redis for balance queries).
  • Horizontal Scaling:
    • Stateless design (wallet logic in DB) supports scaling, but Filament’s Livewire sessions may become a bottleneck.
    • Consider read replicas for transaction history tables.
  • Load Testing: Recommended for production use to validate 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
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity