Laravel Money
Currency formatting and conversion for Laravel without the intl extension.
Repository Health
Technical Analysis
akaunting/laravel-money is a Laravel package for formatting and converting monetary values. It provides Money and Currency value objects, locale-aware formatting, and conversion helpers, all without depending on PHP’s intl extension — which is not installed by default and can produce inconsistent results across servers. It ships a configurable currency list, Blade and helper integrations, and arithmetic operations that keep monetary amounts consistent throughout a Laravel application.
What You Get
- Money and Currency value objects for consistent monetary handling
- Locale-aware formatting that does not require the PHP intl extension
- A configurable list of currencies with symbols, precision and rules
- Conversion and arithmetic helpers for monetary amounts
- Blade directives and helper functions for Laravel views
Common Use Cases
- Formatting prices consistently across an e-commerce Laravel app
- Converting between currencies using configured exchange rates
- Performing safe monetary arithmetic without floating-point surprises
Under The Hood
Architecture - The package models amounts with Money and Currency objects (Akaunting\Money namespace). Currency definitions — symbol, precision, thousands/decimal separators — come from a publishable config file, and formatting is computed from that config rather than PHP’s intl extension, so output is deterministic across servers. A service provider registers the config, helpers and Blade integration.
Tech Stack - PHP 8.2+ built on Laravel’s illuminate contracts, support, validation and view components, plus vlucas/phpdotenv. Tested with PHPUnit and Orchestra Testbench, with Psalm for static analysis.
Code Quality - The repository includes a PHPUnit suite (CurrencyTest, ProviderTest and others) and a Psalm configuration, indicating attention to correctness and types for a focused, well-scoped package.
API Design - The Money/Currency API is expressive and reads naturally, with helper functions and Blade directives for views. Avoiding intl removes a common source of environment-specific surprises, improving predictability.