- Is sebastian/money maintained and safe to use in production?
- No. The repository is archived and the README explicitly states the project has been abandoned, that it was only ever intended as an example for PHPUnit features, and that it should not be used in production. The author redirects users to moneyphp/money. Adopting it means owning every line of the code forever with no maintainer, no security response path, and no PHP 8 support commitment.
- What is sebastian/money and how does it represent monetary values?
- It is a PHP value object that represents a monetary value using a currency's smallest unit, pairing an integer amount with a Currency object so that one EUR is stored as 100 cents. It offers a deliberately minimal API: construction, amount accessors, arithmetic, and comparison, plus currency-specific subclasses such as EUR. Anything beyond that, including allocation, parsing, and currency conversion, is either absent or something you build yourself.
- How do I install sebastian/money with Composer?
- You add sebastian/money to your composer.json require block, typically with the constraint ^1.6, and run composer update. The package is a leaf library with no framework coupling, so there is no service provider to register or publish step to run. It will resolve on most PHP 7.x runtimes, though that does not make it a good idea to ship.
- Does sebastian/money work with PHP 8 and modern Laravel versions?
- It is PHP 5.3-era source with no scalar type hints, no return types, and no strict types declarations, and it carries no CI signal for PHP 8. On PHP 8.1 and later it is untested and unsupported, so any green test run should be treated as luck rather than a guarantee. Every future Laravel or PHP upgrade turns it into a known-broken dependency that must be excused or removed.
- Is there a Laravel service provider, config file, or Eloquent cast in sebastian/money?
- No. The package is a plain value object library with essentially no framework coupling, so there is no service provider, no configuration file, and no facade. There are also no Laravel-idiomatic ergonomics such as Eloquent casts or validation rules, meaning you would write all of that integration glue yourself. The upside is a low architectural blast radius, but that is outweighed by the lack of support.
- What is the best maintained alternative to sebastian/money for Laravel?
- Use moneyphp/money, which is the successor the original author explicitly recommends in the README. It is actively maintained, supports modern PHP versions, and integrates cleanly with Laravel through casts and validation packages. Brick/money is another reasonable option if you need a more modern immutable API with exchange and rounding policies.
- How do I format a Money object as a localized currency string with sebastian/money?
- The library ships an IntlFormatter that wraps PHP's built-in NumberFormatter and accepts a locale, for example de_DE. That formatting path pulls ext-intl into your dependency graph, so any environment that renders money must have the extension installed. If you move to moneyphp/money, formatting is handled by dedicated formatter classes with the same ext-intl requirement.
- What are the currency data and precision risks in sebastian/money?
- The ISO 4217 currency table is hard-coded and frozen in 2013, so it can miss currencies, carry stale minor-unit exponents, and lack support for later redenominations, which is a defect class rather than a cosmetic gap in a payments or accounting domain. Amounts are integers, which is correct, but getConvertedAmount() returns a float and invites float arithmetic back in at exactly the boundary you adopted the library to protect. For regulated money-handling code paths, an unmaintained dependency with stale currency metadata is an audit finding.
- What license does sebastian/money use and what should OSS review check?
- GitHub reports the license as NOASSERTION, so the terms must be confirmed from the repository source headers before any legal review can clear it. In most enterprises an unclassified license combined with an abandoned banner ends the evaluation. Get legal and OSS review involved before any code is written, not after it is in a financial path.
- How do I migrate from sebastian/money to moneyphp/money in a Laravel app?
- Replacing the dependency is a single small refactor because the core abstraction is the same: an integer amount plus a currency. Swap the namespace, replace getAmount() with getMinorAmount(), and replace getConvertedAmount() with a decimal-aware accessor so floats never re-enter your code. While migrating, add Eloquent casts and validation rules so currency handling becomes a framework convention rather than ad hoc code.