LaravelPackages.net
Acme Inc.
Toggle sidebar
xgrz/money

Money helper for Laravel

240
1
v2.0.5
About xgrz/money

xgrz/money is a Laravel package for money helper for laravel. It currently has 1 GitHub stars and 240 downloads on Packagist (latest version v2.0.5). Install it with composer require xgrz/money. Discover more Laravel packages by xgrz or browse all Laravel packages to compare alternatives.

Last updated

Tests

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();
    }
Comments