mathiasverraes/money
Small PHP money library that treats monetary values as immutable value objects to avoid floating-point errors. Includes currency support, arithmetic and comparisons, and formatting helpers—useful for modeling prices, totals, and discounts in a robust, domain-driven way.
Currency::zero() method simplifies creation of zero-value monetary objects, reducing boilerplate for default/placeholder values (e.g., Currency::zero('USD')).zero() for consistent initialization patterns. Reduces technical debt in systems with evolving financial requirements.zero() method further reduces the need for custom implementations.Adopt if:
USD 1,234.56), including standardized zero-value representations (e.g., Currency::zero('USD')).zero().Look elsewhere if:
decimal, Java’s BigDecimal).zero() is additive, not breaking).For Executives:
"This package now includes a Currency::zero() method, which streamlines how we handle default monetary values—critical for accuracy in payments, billing, or global sales. For example, it eliminates manual creation of zero-balance objects (e.g., for uninitialized transactions or free tiers), reducing errors and developer time. Used by 4.8K+ projects and maintained actively (last update: May 2026), it’s a low-risk way to enforce financial precision. We can accelerate features like multi-currency checkout or audit trails while mitigating compliance risks. The MIT license ensures no legal blockers."
For Engineering:
*"The new Currency::zero() method adds a clean way to create zero-value monetary objects (e.g., Currency::zero('USD')), cutting boilerplate and standardizing defaults across the codebase. Key benefits:
new Money(0, 'USD') with Currency::zero('USD') for clarity and consistency.Money::USD(0)->format() or Currency::zero('USD')->format()).How can I help you explore Laravel packages today?