Download the PHP package cknow/laravel-money without Composer
On this page you can find all versions of the php package cknow/laravel-money. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cknow/laravel-money
More information about cknow/laravel-money
Files in cknow/laravel-money
Package laravel-money
Short Description Laravel Money
License MIT
Homepage https://github.com/cknow/laravel-money
Informations about the package laravel-money
Laravel Money
Note: This project abstracts MoneyPHP
Installation
Run the following command from you terminal:
or add this to require section in your composer.json file:
then run composer update
Usage
Configuration
The defaults are set in config/money.php
. Copy this file to your own config directory to modify the values. You can publish the config using this command:
This is the contents of the published file:
Advanced Usage
See MoneyPHP for more information
Create your formatter
Rules
Below is a list of all available validation rules and their function:
currency
The field under validation must be a valid currency.
money
The field under validation must be a valid money.
Casts
At this stage the cast can be defined in the following ways:
In the example above, if the model attribute currency
is null
,
the currency defined in the package configuration is used instead.
Setting money can be done in several ways:
When we pass the model attribute holding the currency, such attribute is updated as well when setting money:
Helpers
Blade Extensions
All versions of laravel-money with dependencies
ext-json Version *
ext-intl Version *
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/view Version ^9.0|^10.0|^11.0
moneyphp/money Version ^4.6