filament-withdrawals
Manage your withdrawals in Filament
يمتدّ من filament
composer require tomatophp/filament-withdrawals- filament-plugins
- payment
- payment-wallet
- wallet
- wallet-withdrawals
اقرأني

Filament Withdrawals
Manage wallet withdrawals in FilamentPHP: withdrawal methods with their own dynamic request forms, and a withdrawal requests inbox to process, complete (withdraw from the wallet) or cancel requests.
Screenshots

Compatibility
| Package | Filament | Laravel | PHP |
|---|---|---|---|
| 5.x | 5.x | 12.x / 13.x | 8.3+ |
| 4.x | 4.x | 11.x / 12.x | 8.2+ |
Requirements
Withdrawals are paid out of Filament Wallet balances, so the model that requests a withdrawal
(your User, or an Account when you use Filament Accounts) needs a wallet:
Installation
after install your package please run this command (it runs the pending wallet and withdrawals migrations)
if your app does not have the Spatie media library media table yet, publish and run its migration first
finally register the plugin on /app/Providers/Filament/AdminPanelProvider.php
you will usually register the wallet plugin too, to see the balances and transactions
Config
Relation Fields (allowlist)
A select field of a withdrawal method can load its options from a model ("Is Relation" in the field editor). For security, only the models (or relationship names) and columns listed in config/filament-withdrawals.php can be used:
- the allowlist is empty by default, so relation fields render without options until you list them;
- the field editor only offers the allowlisted models and columns, and validates the choice on the server;
- hidden attributes of a model (
password,remember_token, anything in$hidden) are never shown, even when listed; - a model or column that is not listed is never queried.
Upgrading from 5.0.0: if your withdrawal methods use relation fields, add their model and column to
relations, otherwise those fields show no options.
Add Form Field Type
you can add more fields to the form builder by use this method on your provider. Registering a type with an existing name replaces it.
Use Your Form Builder
after create your withdrawal method you can use its form by id like this
Submit a Withdrawal Request
the request is created for the signed-in user after checking the method limits, the wallet balance and that no other request is pending.
Publish Assets
you can publish languages file by use this command
you can publish migrations file by use this command
Testing
Other Filament Packages
Checkout our Awesome TomatoPHP