Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Money Laravel Package

brick/money

Brick\Money is a PHP library for precise, immutable money and currency values. It provides exact arithmetic (no float errors), explicit rounding control, and supports large amounts via brick/math, with optional GMP/BCMath acceleration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Financial precision in e-commerce: Eliminates floating-point rounding errors in pricing, discounts, and tax calculations (e.g., cart totals, checkout flows).
  • Multi-currency support: Enables seamless handling of international transactions (e.g., cross-border payments, currency conversion APIs).
  • Compliance with ISO 4217: Ensures accurate currency representation for regulatory reporting (e.g., financial audits, tax filings).
  • Custom rounding rules: Supports cash-based rounding (e.g., Swiss Franc’s 5-cent increments) for POS systems or legacy integrations.
  • Advanced allocations: Facilitates profit-sharing, revenue splits, or subscription billing with precise fractional distribution (e.g., SaaS tiered pricing).
  • Immutable design: Safeguards against concurrent modification bugs in high-traffic systems (e.g., payment processing microservices).
  • Roadmap: Justifies investing in a build vs. buy decision for financial math, avoiding reinventing wheel for core arithmetic.
  • Use cases:
    • Pricing engines (dynamic discounts, tiered plans).
    • Accounting systems (invoice generation, reconciliation).
    • Marketplaces (multi-vendor payouts, fee calculations).
    • Cryptocurrency platforms (stablecoin pegging, fractional trading).

When to Consider This Package

  • Adopt if:

    • Your app handles monetary values with precision (e.g., >$1M/year revenue, high-frequency transactions).
    • You need exact arithmetic (e.g., auditable ledgers, legal compliance).
    • Your stack is PHP/Laravel and you lack a dedicated financial library.
    • You require custom rounding (e.g., cash-based currencies like CHF, JPY).
    • Your team lacks time to build/validate financial math from scratch.
  • Look elsewhere if:

    • You’re using JavaScript/TypeScript (consider money.js or decimal.js).
    • Your needs are simple (e.g., basic currency display; use Laravel’s built-in Money facade).
    • You need blockchain-specific features (e.g., token decimals; use web3.php).
    • Your team prefers Python/Ruby (e.g., python-decimal, money-rails).
    • You require real-time exchange rates (pair with an API like exchangerate-api).

How to Pitch It (Stakeholders)

For Executives:

"This package solves a critical technical debt in our financial calculations. Currently, floating-point errors in PHP can silently corrupt transaction totals—costing us [X] in disputes or lost revenue annually. Brick\Money guarantees precision, reduces fraud risk, and future-proofs our multi-currency support (e.g., global expansion). It’s a low-risk, high-impact upgrade with MIT licensing and 1.9K+ adopters. ROI: fewer chargebacks, faster audits, and scalable pricing logic."

Ask: "Can we allocate [Y] dev hours to integrate this for our [checkout/accounting] system?"


For Engineering:

*"Brick\Money is a battle-tested, immutable library for exact monetary arithmetic in PHP. Key benefits:

  • No more 0.1 + 0.2 = 0.30000000000000004 bugs—uses rational numbers under the hood.
  • Contexts for real-world use cases: Cash rounding (CHF), custom scales (e.g., 4-decimal crypto), or auto-scaling for intermediate calculations.
  • Seamless Laravel integration: Works with Eloquent, APIs, and queues (e.g., Money::of(100, 'USD')->plus($tax)).
  • Performance: Optimized with GMP/BCMath (install optional extensions for speed).
  • Maintenance: Actively developed (last release: 2026), ISO 4217 compliant, and MIT-licensed.

Proposal:

  1. Spike: Validate integration with our existing Money facade (1 day).
  2. Pilot: Replace floating-point math in [high-risk module, e.g., invoicing] (1 week).
  3. Rollout: Phase out legacy float calculations across [X] services.

Blockers to address:

  • PHP 8.2+ requirement (upgrade path?).
  • BCMath/GMP dependencies (benchmark impact).
  • Team training on immutable patterns and rounding modes."*

Ask: "Should we prioritize this over [competing initiative] given its impact on [revenue/audit risk]?"

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope