Weave 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

Php Prices Laravel Package

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.

Deep Wiki
Context7

Product Decisions This Supports

  • Pricing model architecture: whether money is represented as a first-class value object (amount + currency) or as loose floats/decimals scattered across models, views, and jobs. This package supports the former, which is the decision that prevents a long tail of rounding and mismatch defects.
  • Build vs. buy for "money math": buy the currency-safe arithmetic and formatting layer (MIT, small surface area) instead of maintaining bespoke rounding, parsing, and display helpers. Your team's build effort stays on pricing rules, not on reimplementing arithmetic.
  • Multi-currency roadmap: a currency-aware price type turns "sell in EUR/USD/GBP" from a data-model migration into configuration and presentation work. Decide now whether multi-currency is a year-one requirement; the answer changes what you adopt today.
  • Feature scoping and policy explicitness: centralizing price handling forces decisions like "round at line item or order level," "display tax-inclusive or exclusive," and "where do discounts apply" to be stated in one place rather than emerging from whichever code path ran.
  • Use cases: e-commerce catalog and cart totals, quotes and invoices, subscription and plan pricing, per-customer B2B price lists, fees/shipping/surcharges, tips and donations, marketplace payout calculations.
  • Revenue-risk reduction: fewer floating-point and formatting defects means fewer refunds, failed reconciliations, finance escalations, and support tickets on checkout.

When to Consider This Package

Consider adopting when:

  • You are building a PHP product (Laravel fits naturally) where prices appear in multiple places and money handling is currently ad hoc.
  • You need one consistent way to add, multiply, discount, round, compare, and format amounts.
  • You expect currency or locale requirements to grow and want the data model to absorb that cheaply.
  • You want a dependency small enough to read, test, and fork — MIT licensing makes abandonment survivable.
  • Your domain is "prices and arithmetic," not full accounting.

Look elsewhere when:

  • You need FX conversion and rate feeds, tax determination (VAT/nexus rules), or a full billing and ledger engine. Those are separate vendors, not a value-object library.
  • You need audit-grade double-entry accounting; this is not a ledger.
  • You are not on PHP, or your stack already standardizes on a money library (e.g. moneyphp/money) — layering a second idiom creates confusion rather than safety.
  • You require vendor SLAs, security attestations, or commercial support. Modest adoption (~171 stars), an unverified repository reference, and a thin release history mean this should be treated as an internally owned dependency, not a supported product.
  • Your real problem is pricing policy — promotions, tiers, proration, coupons. The package gives you correct arithmetic, not a rules engine.

Adoption criteria before it reaches checkout:

  • Pin the version and confirm compatibility with your PHP/Laravel versions.
  • Add characterization tests around rounding modes, zero-decimal currencies, and negative amounts.
  • Wrap it behind your own facade or service so a fork or replacement is a contained change.
  • Assign an internal owner for upgrades and security review.

How to Pitch It (Stakeholders)

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."

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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core