Download the PHP package ibrand/laravel-currency-format without Composer
On this page you can find all versions of the php package ibrand/laravel-currency-format. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-currency-format
laravel-currency-format
Laravel 贴合实际需求同时方便扩展的数字,金额格式化组件
基于业务需求,需要把数字,金额格式化以方便前端展示,laravel Eloquent
官方提供了修改器,如将以分
为单位的amount
字段换算成元
:
Featrue
- 自定义需要转换的字段
Trait
即引即用FormatContract
方便扩展开发- 支持
toArray
数组化
安装
使用
- 定义
Eloquent Model
模型 - 引用 格式化
Trait
模型:use iBrand\Currency\Format\HasFormatAttributesTrait
- 自定义格式化字段:
protected $format_attributes
就是这么简单
如访问
格式化total
属性,$order->display_total
即可。
All versions of laravel-currency-format with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
The package ibrand/laravel-currency-format contains the following files
Loading the files please wait ....