Filament V3 unlike V2 that uses laravel-money package for formatting money TextColumns uses PHP native NumberFormatter class.
A new currency(string | Closure $currency = null, bool $shouldConvert = false)
method to the TextColumn
that uses the Filament V2 money formatter.
The summarizer classes Sum
and Average
contains the method currency(string | Closure $currency = null, bool $shouldConvert = false)
to display the value in the configured currency format.
A new currency(string | Closure $currency = null, bool $shouldConvert = false)
method to the TextEntry
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.
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.
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
\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)
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.