xgrz/money

Money helper for Laravel

Maintainers

Details

github.com/xGrz/money

Source

Issues

Installs: 71

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/xgrz/money

v2.0.1 2025-09-16 15:00 UTC

This package is auto-updated.

Last update: 2025-09-16 15:02:23 UTC


README

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