When working with FilamentPHP, one of the most common form fields we use is numeric input — especially when dealing with prices, balances, or other money-related data. However, formatting and validating currency values can quickly become messy.
That’s why I built Filament Money, a lightweight Filament plugin that makes handling money inputs clean, simple, and developer-friendly.
✨ What Is Filament Money?
Filament Money is a FilamentPHP plugin that provides an easy-to-use money input field, complete with:
- Currency formatting (default:
IDR) - Configurable decimal places
- Seamless integration with Filament Forms
It’s designed to help you focus on building features — not fighting with number formatting.
⚙️ Installation
You can install the package via Composer:
composer require codewithdiki/filament-money
Optionally, you can publish the config file to customize default settings:
php artisan vendor:publish --tag="filament-money-config"
The published config file looks like this:
return [
'currency' => 'IDR',
'decimal_places' => 2
];
You can also publish the views if you need to customize the UI:
php artisan vendor:publish --tag="filament-money-views"
💡 Usage Example
Once installed, you can use it directly in your Filament form components:
use CodeWithDiki\FilamentMoney\Forms\Components\Money;
Money::make('price');
That’s it — your input field will automatically format and handle currency values based on your configuration.
🧱 Why I Built It
When I was building a POS-style application using Filament, I found myself repeating the same logic for handling prices — adding currency symbols, formatting decimals, and making sure the value was stored cleanly in the database.
Instead of rewriting that code again and again, I decided to package it properly — so both I and other developers could reuse it easily. Thus, Filament Money was born.
🤝 Contributing
If you have ideas for improvements or additional features (like auto currency conversion or live formatting), feel free to contribute! Pull requests are welcome on GitHub → codewithdiki/filament-money.
🧾 License
This package is open-source software licensed under the MIT License — you’re free to use and modify it for your own projects.
🔗 Quick Links
- GitHub Repository: github.com/codewithdiki/filament-money
- Packagist: packagist.org/packages/codewithdiki/filament-money
🚀 Final Thoughts
Filament Money is a small but handy tool that saves time and ensures consistency when dealing with monetary inputs in FilamentPHP.
Whether you’re building e-commerce, POS, or financial dashboards, this plugin keeps your forms clean and your data properly formatted — just like it should be.