sebastian/money
Sebastian/money is an abandoned PHP value object library for monetary values using a currency's smallest unit, with formatting and currency subclasses. It was intended as a PHPUnit example, not for production; use moneyphp/money instead.
Bottom line: This is not a dependency to adopt. It is an archived 2013 library whose own author states it was never intended for production and redirects users to moneyphp/money. A TPM's leverage here is not integration — it is using the package as a design reference and a governance example, and steering the team to the maintained successor. The 7.11 composite score and 15.5 "opportunity" score are artifacts of the scoring model, not evidence of viability; Dependents: 0 and Archived: yes are the decisive signals.
Architecture fit
Money value object holding an integer amount in a currency's smallest unit plus a Currency is exactly the right domain primitive for a Laravel application (orders, invoices, wallets, payouts, tax lines). Immutability, self-validation, and currency pairing are the properties you want.IntlFormatter that pulls ext-intl into any formatting path.Integration feasibility
composer require sebastian/money:^1.6 will resolve on most PHP 7.x runtimes. On PHP 8.1+ it is untested and unsupported; expect friction from deprecated behaviors, and treat any green test run as luck rather than a guarantee.NOASSERTION, so the license must be confirmed from the repository headers before any legal review can clear it. In most enterprises an unclassified license plus an "abandoned" banner ends the evaluation.Technical risk
getConvertedAmount() returns a float, which invites float arithmetic back into the codebase at exactly the boundary you adopted the library to protect.Key questions to resolve before any code is written
NOASSERTION? What is the policy for unclassified licenses?moneyphp/money instead, is the team's objection about API familiarity, bundle size, or something substantive we can address directly?Stack fit
moneyphp/money.moneyphp/money is the intended successor, is actively maintained, is the de facto standard across the PHP ecosystem, and covers the same value-object contract plus allocation, parsing, and formatting. It is the only defensible choice for production.App\Support\Money\MoneyFactory and an Eloquent cast) so the underlying package is swappable and testability is preserved.Migration path
sebastian/money at all. Go straight to moneyphp/money, pinned, with ext-bcmath/ext-gmp available and Composer audit enabled.new Money(int, Currency), getAmount, getConvertedAmount, add/subtract, equals) onto the successor; the shapes are close enough that a mechanical port is feasible per call site.float in money-typed signatures and ban direct construction outside the factory. This is the durable safeguard; the library choice is secondary.Compatibility
ext-intl availability in the container image, and BCMath/GMP presence before committing. Formatting and arithmetic extensions are the usual surprise in CI versus local.BIGINT with an explicit currency column; never FLOAT/DOUBLE. This matters more than the library and survives any future swap.Sequencing
sebastian/money with the readme disclaimer and archive status as cited rationale. This is the deliverable.moneyphp/money; capture rounding-mode behavior and allocation semantics in tests.float.sebastian/money from composer.json, confirm composer why returns nothing, and note the replacement in the dependency inventory.Maintenance
Support
Scaling
Failure modes to design against
getConvertedAmount() float value re-entering arithmetic, producing sub-cent drift that only surfaces at reconciliation.Money instances of different currencies; ensure the exception path exists and is tested, and that it is caught at the domain boundary rather than in a controller.Ramp-up
How can I help you explore Laravel packages today?