承接 momenoor/filament-currency 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

momenoor/filament-currency

最新稳定版本:v1.0.0

Composer 安装命令:

composer require momenoor/filament-currency

包简介

Bring back laravel-money formatter for Filament Text Column

README 文档

README

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

Filament V3 unlike V2 that uses laravel-money package for formatting money TextColumns uses PHP native NumberFormatter class.

Text Column (Table Builder)

A new currency(string | Closure $currency = null, bool $shouldConvert = false) method to the TextColumn that uses the Filament V2 money formatter.

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 momenoor/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.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-07