ariaieboy / filament-currency
Bring back laravel-money formatter for Filament Text Column
Fund package maintenance!
ariaieboy
Installs: 157 491
Dependents: 6
Suggesters: 0
Security: 0
Stars: 66
Watchers: 2
Forks: 13
Open Issues: 0
Language:Blade
pkg:composer/ariaieboy/filament-currency
Requires
- php: ~8.2|~8.3|~8.4
- akaunting/laravel-money: ^6
- filament/tables: ^4.0
- illuminate/contracts: ^12.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^3
- laravel/pint: ^1.0
- nunomaduro/collision: ^8
- orchestra/testbench: ^10.0
- pestphp/pest: ^3.7
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
This package is auto-updated.
Last update: 2025-10-20 07:13:55 UTC
README
This package provides some macros for TextColumn, TextEntry and summerizer Average and Sum to format the money values using the laravel-money.
We also provide a currencyMask() method for TextInput and TextInputColumn to mask your numbers in front-end and return the plain number to back-end.
Text Column (Table Builder)
A new currency(string | Closure $currency = null, bool $shouldConvert = false) method to the TextColumn that uses the laravel-money to format currencies.
Summary (Table Builder)
The summarizer classes Summarizer, Sum and Average contains the method currency(string | Closure $currency = null, bool $shouldConvert = false) to display the value in the configured currency format.
Text Entry (InfoLists)
A new currency(string | Closure $currency = null, bool $shouldConvert = false) method to the TextEntry
Text Input (Form Builder)
We also have a currencyMask() method for TextInput that lets you mask your numbers in front-end and return the plain number to back-end.
Text Input Column (Table Builder)
We also have a currencyMask() method for TextInputColumn that lets you mask your numbers in front-end and return the plain number to back-end.
By using this package you can configure the formatter using laravel-money config.
For example, you can customize the symbol, symbol_first, decimal_mark, and thousands_separator for each currency. Or if you want you can add your custom currency to the config and use it in the currency() method instead of standard money.
Installation
You can install the package via Composer:
composer require ariaieboy/filament-currency
You can publish the laravel-money config file with:
php artisan vendor:publish --tag=money
Usage
\Filament\Tables\Columns\TextColumn::make('money') ->currency('USD'); \Filament\Tables\Columns\TextColumn::make('money') ->currency('USD') ->summarize(\Filament\Tables\Columns\Summarizers\Sum::make()->currency()); \Filament\Tables\Columns\TextColumn::make('money') ->currency('USD') ->summarize(\Filament\Tables\Columns\Summarizers\Average::make()->currency()); \Filament\Infolists\Components\TextEntry::make('money') ->currency('USD'); \Filament\Forms\Components\TextInput::make('money') ->currencyMask(thousandSeparator: ',',decimalSeparator: '.',precision: 2)
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.