whitecube/php-prices
A PHP library for working with prices and currencies: immutable Price objects, VAT rates, discounts, arithmetic, and locale-aware formatting/parsing via intl. Framework-agnostic, with optional Laravel integration.
Consider adopting when:
Look elsewhere when:
moneyphp/money) — layering a second idiom creates confusion rather than safety.Adoption criteria before it reaches checkout:
For executives: "Money bugs are revenue bugs. This is a small, free (MIT) library that gives our code one correct way to store, calculate, and display prices. It reduces the risk of rounding errors and refund/reconciliation problems in checkout and billing, and it makes multi-currency expansion a smaller project later. Direct cost is effectively zero; the real commitment is a short integration effort plus tests, and an internal owner so we are not dependent on an outside maintainer."
For engineering: "We stop hand-rolling float math and formatting. Prices become immutable value objects — amount plus currency — that we can add, multiply, discount, compare, and render consistently. The API surface is small enough to read in an afternoon, and MIT means we can fork if it stalls. Two caveats: adoption is modest, and it handles arithmetic only — not tax rules or FX. So we pin the version, wrap it behind our own price service, and cover rounding and currency edge cases with tests before it touches the checkout path."
How can I help you explore Laravel packages today?