overtrue/laravel-revaluation
A Laravel package for currency revaluation, offering configurable exchange rates and simple helpers to convert and update monetary values, helping keep prices, invoices, and other currency-based data consistent across your application.
Architecture fit. The package follows the classic Laravel 5.x package shape: a service provider, a facade alias, a publishable config file for currency definitions, a rate-provider abstraction, and a cache decorator around provider lookups. That decomposition is the right one for a multi-currency feature — a RateProvider contract, a cached repository, and a thin converter service — and it maps cleanly onto a domain module in a modern Laravel app. The problem is the implementation era, not the design: the code targets PHP 7.0 / Laravel 5.5–5.8 idioms (no scalar/return types, likely use of helpers removed in Laravel 6+, illuminate/support constraints pinned to old majors, facade registration via config/app.php rather than package discovery conventions we may rely on).
Integration feasibility. As a composer require dependency: low. Archived since 2018-03-28, 30 stars, no upstream patches. On Laravel 9+/PHP 8.2 you will either fail platform constraints or be forced into --ignore-platform-reqs, which is an unacceptable production posture. As a reference implementation and specification: high. The provider contract plus cache wrapper is perhaps a few hundred lines; copying and re-homing it into our own Currency module costs a day or two and eliminates the dependency.
Technical risk.
NumberFormatter); unclear handling of negative amounts (credits/refunds), zero-decimal currencies (JPY), and three-decimal currencies (BHD, KWD).Key questions for the spike.
Stack fit. Only a fit if we are on Laravel 5.x / PHP 7.x. On anything modern, treat this repository as a design input, not a runtime dependency. Its README and config file are effectively a free requirements checklist for the feature.
Migration path. Three viable options, in order of preference:
RateProvider interface, CachedRateProvider decorator, CurrencyConverter service — into app/Domain/Currency with our own types, brick/money (or moneyphp/money) for arithmetic, and our treasury/ECB/vendor feed behind the provider contract.illuminate/support ^10||^11 → add tests → publish internally. Carries permanent ownership cost.Compatibility checks before deciding. Run composer why-not against the target app; grep the source for removed helpers (array_get, str_*, camel_case); confirm the facade alias and config-publish tags do not collide with existing config keys; confirm how it resolves the HTTP client (Guzzle major version conflicts are the usual killer).
Sequencing.
RateProvider, RateRepository (with persistence for historical snapshots), and rounding policy. Borrow the package's interface shape where it is sound.TPM leverage. Frame this as "we found a prior-art implementation that de-risks the contract design and costs us two days to evaluate." That is a cheap, defensible win regardless of the adopt/replace outcome — and it prevents a team from gold-plating a rate-provider abstraction from scratch.
Maintenance. Archived means zero upstream: no bug fixes, no PHP-version bumps, no security patches, no response to issues. Every line becomes ours the moment we depend on it. If we adopt as-is, assign a named owner and a calendar reminder to review at each Laravel major upgrade; if we extract, the maintenance surface is limited to our own module and is straightforward.
Support. No community to escalate to (30 stars, no maintainer activity since 2018). Internal support only, which means the on-call runbook must be written by us — including what to do when a rate feed returns garbage or nothing.
Scaling. Conversion math is trivially cheap; the actual scaling concerns are (a) cache hit ratio and stampede behavior on TTL expiry, (b) provider rate limits and cost per call, and (c) reporting queries over historical rates — which need a persisted rate table and an index on (base, quote, as_of_date), not a live API call per row. None of these are solved by the package's cache layer alone.
Failure modes to design for explicitly.
1.0 fallback is a financial incident.USD vs usd) must be enforced centrally.Ramp-up. The codebase is small enough that a mid-level engineer can read it in an afternoon; the package is not the learning curve. The real ramp-up is domain fluency — minor units, rounding conventions, rate snapshotting at transaction time, and the difference between "current rate for display" and "booked rate for the ledger." Budget onboarding around a short written policy doc (rate sourcing, rounding, failure handling) rather than around this repository, and treat the package as the worked example that doc references.
How can I help you explore Laravel packages today?