- How do I install overtrue/laravel-revaluation?
- Install it with composer require overtrue/laravel-revaluation on a Laravel 5.x project running PHP 7.0, then register the package service provider and facade alias in config/app.php and publish the config file with php artisan vendor:publish. It predates package discovery, so Laravel will not register it automatically. Because the repository has been archived since 2018, treat the install as a spike on a throwaway app rather than a step in a production upgrade.
- Does overtrue/laravel-revaluation work with Laravel 9, 10 or 11?
- No. The composer constraints and code idioms target Laravel 5.5 through 5.8 and PHP 7.0, with no scalar or return types and helper functions that were removed in later Laravel releases. On Laravel 9+ and PHP 8.2 you will either hit platform constraint failures or be pushed into --ignore-platform-reqs, which is not an acceptable production posture. Port the provider contract and cached converter into your own module instead.
- How do I configure currencies and exchange rates in laravel-revaluation?
- Currency definitions and rate settings live in a publishable config file, and lookups go through a rate-provider abstraction wrapped by a cache decorator. You point the provider at your own feed or the bundled source, then use the facade helpers to convert and update monetary values. Read the source for the exact config keys, because the README is thin and the bundled endpoints date from 2018.
- What happens when an exchange rate is missing or the rate provider is down?
- The documentation does not state this clearly, and it is the first thing to verify in the source. A silent fallback to a rate of 1.0 would be a release blocker for anything touching prices or invoices. Decide explicitly whether you want an exception, a null result, or a stale-cache read, and enforce that behaviour in your own wrapper.
- Is overtrue/laravel-revaluation safe for production invoicing and pricing?
- Not as a runtime dependency. Financial correctness is under-specified: it is unclear whether amounts are floats or integer minor units, where rounding is applied, and how negative amounts and zero-decimal currencies are handled. Invoicing also needs the rate snapshotted at transaction time, while the package appears to expose latest-rate lookups only. Use it as a specification and a reference implementation, not as the engine.
- How does caching work in laravel-revaluation and can I control the TTL?
- The package wraps provider lookups in a cache decorator, so repeated conversions avoid hitting the upstream rate source. Whether the TTL is configurable from the published config, and whether there is stampede protection or negative caching on provider failure, is not documented and should be confirmed in code. For high-traffic apps, put your own cache layer with locking in front of any provider call.
- Does it store historical exchange rates or only the latest rate?
- The provider contract appears to answer latest-rate queries only, with no documented as-of date parameter. That is a problem for invoices and reports, which must record the rate used at transaction time rather than reconverting at read time. Snapshot the rate into your own table alongside the amount, and never re-derive historical totals from a current rate.
- Can I use it with zero-decimal currencies like JPY or three-decimal currencies like BHD?
- There is no evidence in the docs or config that currency exponents are modelled. Conversions that assume two decimals will be wrong for JPY, KWD and BHD, and rounding differences compound across totals. Use a money library such as brick/money or moneyphp/money that carries the currency exponent with the amount.
- Is overtrue/laravel-revaluation still maintained?
- No. The repository has been archived since 28 March 2018, has around 30 stars, and receives no upstream patches or security fixes. It parses third-party HTTP responses and writes to cache, so there is no CVE feed watching it either. Assume you own any code you adopt from it.
- What are the alternatives to overtrue/laravel-revaluation?
- For arithmetic use moneyphp/money or brick/money, and put your own RateProvider interface and cached decorator in front of a treasury, ECB or vendor feed. The package's own layering, a provider contract plus cache wrapper plus thin converter, is a good template to copy into app/Domain/Currency. Copying a few hundred lines is usually cheaper than forking an archived Laravel 5 package and carrying it forever.