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

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Precision Financial Calculations: Enables accurate handling of monetary values (e.g., multi-currency transactions, rounding, and arithmetic) without floating-point errors, critical for e-commerce, fintech, or billing systems. The new Currency::zero() method simplifies creation of zero-value monetary objects, reducing boilerplate for default/placeholder values (e.g., Currency::zero('USD')).
  • Scalable Architecture: Supports modular design by abstracting currency logic into reusable components, including utility methods like zero() for consistent initialization patterns. Reduces technical debt in systems with evolving financial requirements.
  • Compliance & Risk Mitigation: Aligns with financial best practices (e.g., ISO 4217 currency codes) and now includes a standardized way to represent zero-balance transactions, which is useful for audit trails and reporting.
  • Roadmap Acceleration: Shortens development time for features like:
    • Dynamic pricing (e.g., subscriptions, discounts) with clean zero-value placeholders.
    • Multi-currency checkout (e.g., global SaaS platforms) where zero-balance states (e.g., uninitialized carts) are common.
    • Audit trails for financial transactions (e.g., refunds, adjustments) with standardized zero-value representations.
  • Build vs. Buy: Avoids reinventing wheel for core financial logic; prioritizes time/money for differentiating features (e.g., UX, integrations). The zero() method further reduces the need for custom implementations.
  • Use Cases:
    • Fintech: Portfolio management, payment processing (e.g., zero-balance accounts, placeholders).
    • E-commerce: Cross-border sales, tax calculations (e.g., zero-rated transactions).
    • SaaS: Tiered pricing, usage-based billing (e.g., free-tier defaults).
    • Marketplaces: Fee structures, payouts (e.g., unprocessed transactions).

When to Consider This Package

Adopt if:

  • Your PHP backend handles monetary values (e.g., payments, invoices, ledgers) and requires precision (e.g., cents, fractions of currency).
  • You need currency conversion, arithmetic operations, or formatting (e.g., USD 1,234.56), including standardized zero-value representations (e.g., Currency::zero('USD')).
  • Your team lacks deep financial domain expertise but needs reliable, tested implementations of Fowler’s Money pattern, now with utility methods like zero().
  • You’re using Laravel or a PHP stack and want seamless integration with frameworks (e.g., Eloquent models, API responses), including simplified zero-value handling.
  • You frequently work with default/placeholder monetary values (e.g., uninitialized transactions, free tiers).

Look elsewhere if:

  • You need real-time exchange rates (this package doesn’t fetch live data; pair with an API like ExchangeRate-API).
  • Your use case involves complex financial instruments (e.g., derivatives, options) beyond basic currency/cash.
  • You’re constrained by license incompatibility (MIT is permissive, but audit internal policies).
  • Your team prefers non-PHP stacks (e.g., Python’s decimal, Java’s BigDecimal).
  • You require backward compatibility with older codebases that explicitly avoid zero-value methods (though zero() is additive, not breaking).

How to Pitch It (Stakeholders)

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:

  • No more manual zeros: Replace new Money(0, 'USD') with Currency::zero('USD') for clarity and consistency.
  • Laravel-friendly: Works seamlessly with Eloquent, API responses, and validation (e.g., Money::USD(0)->format() or Currency::zero('USD')->format()).
  • Lightweight: ~1MB, zero dependencies beyond PHP 8.0+, with zero breaking changes.
  • Tested: Used in production by teams at Shopify, Laravel, etc., now with an additional utility method. Proposal: Adopt this method in [Module X] by [Date] to standardize zero-value handling. Estimated 1 dev-day to refactor, with immediate readability and maintainability gains."*
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky