xgrz / money
Money helper for Laravel
v2.0.0
2025-03-30 10:07 UTC
Requires
- php: ^8.1
- illuminate/support: ^10.0 || ^11.0 || ^12.0
Requires (Dev)
- larastan/larastan: ^2.0 || ^3.0
- orchestra/testbench: ^8.0 || ^9.0 || ^10.0
- phpstan/phpstan: ^1.0 || ^2.0
- phpunit/phpunit: ^10.0 || ^11.0
README
Money formatter/calculator for Laravel
Money is small package for money format for Laravel. It works with Laravel 10, 11 and 12 (PHP 8.1-8.4)
Installation
composer require xgrz/money
Example usage
use XGrz\Money\Money;
try {
$money = Money::from(1234.567, precision: 2)
->currency('€', beforeAmount: true)
->decimalSeparator('.')
->thousandsSeparator(',')
->shouldDisplayZero(false);
echo $money->format(); // €1,234.57
} catch (MoneyValidationException $e) {
echo "Error: " . $e->getMessage();
}