webrek/laravel-money
A Laravel package for working with money and currencies in your application. It offers convenient helpers and integrations for formatting, parsing, and managing monetary values safely, helping keep currency handling consistent across models, views, and business logic.
Money::sum(), min(), max() and the sumMoney() Collection macro remove bespoke aggregation logic from carts, order totals, invoice subtotals, payout summaries and reporting dashboards. Teams can ship totals, best/worst price views and “sum by currency/key” screens without inventing internal money utilities.Money::percentage() gives product and engineering a shared, explicit primitive for percentage-based calculations (VAT, sales tax, promo discounts), reducing the risk of ad-hoc float math spreading across pricing, checkout and invoicing.sumMoney() behaviour and iterable-based APIs make empty-state handling a product decision rather than an exception path, which is useful for zero-state dashboards and new-account experiences.Consider adoption when:
sumMoney(), optional key-based aggregation) rather than hand-rolled reducers.Look elsewhere or supplement when:
For executives: This release lets us deliver money-related features faster and with less financial risk. Totals, tax and discount calculations, and “sum by currency” reporting can be built on a maintained package instead of custom code, reducing defect exposure in checkout, invoicing and dashboards. It is an additive, low-migration-cost upgrade that improves time-to-market for revenue-adjacent roadmap items without committing us to a larger finance platform.
For engineering: v1.2.0 adds Money::sum(), min(), max() over iterables, Money::percentage() for tax/discount calculations, and a sumMoney() Collection macro with optional key-based aggregation and null-on-empty semantics. This is additive and should be a straightforward dependency bump. It replaces common hand-written reducers and percentage math, giving us one tested implementation for rounding, currency consistency and empty-collection handling. Engineering should still define rounding policy, validate currency-mixing behaviour in domain tests, and confirm database decimal precision and casting around persisted amounts.
Recommendation: Adopt v1.2.0 for financial aggregation and percentage calculations where the product already uses Laravel Collections. Treat it as a computation primitive, not a replacement for FX, ledger or accounting controls, and gate adoption on a short spike covering rounding policy, mixed-currency inputs and empty-state UX.
How can I help you explore Laravel packages today?