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

Currency Bundle Laravel Package

lexik/currency-bundle

Symfony bundle for multi-currency apps: manages currency definitions, fetches exchange rates from configurable providers, converts amounts, and integrates with Twig, forms, and Doctrine. Ships with caching, CLI tools, and an extensible provider architecture. Ideal for e-commerce and billing.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor as a dependency, moderate as a reference. This is a Symfony2 bundle, not a framework-agnostic library. Everything of value is wired through Symfony's DependencyInjection extension and consumed as $container->get('lexik_currency.converter'), with presentation delivered as a Twig extension. Laravel has no bundle/DI-extension concept, no auto-discovered service provider, and the package does not target illuminate/*. There is no drop-in integration path.

Decomposing what the package actually contains:

Component Reusable in Laravel? Notes
Conversion math (rate multiply + rounding) Yes, but trivial ~50 LOC, not worth a dependency
ECB exchange-rate provider (HTTP fetch + XML parse) Yes — the only real asset ~100–200 LOC
Doctrine ORM persistence of rates No Conflicts with Eloquent
Twig filters/directives No Useless in Blade
Symfony DI/config tree No Dead weight

Integration feasibility — low. composer require into a Laravel 10/11 app will almost certainly fail or drag in Symfony 2.x components that conflict with the framework's symfony/* v6/v7 constraints. Forcing it with --ignore-platform-reqs inherits an unmaintained transitive tree.

Technical risk — high. Symfony2 has been EOL since 2018; PHP constraints are likely ^5.3|^7.0. No security patching, no CVE process, 58 stars and 0 dependents means effectively no third-party review. The ECB reference feed is a single upstream with no fallback provider in the bundle.

Key questions to resolve before committing:

  • Do we need live FX, or a periodic rate table? (Most commerce/pricing cases need the latter — which makes the package's value proposition even thinner.)
  • Which currencies, and what rounding policy — half-up, bankers, ISO 4217 minor units?
  • Is there an accounting/legal requirement to record rate provenance and as_of timestamps?
  • Do we need historical rates for refunds, reporting, or reconciliation?
  • Is a paid FX API acceptable, or are we constrained to free ECB daily references?

Integration Approach

Stack fit: treat this as a reference implementation, not a package. Recommended decision: do not composer require it.

Target stack: moneyphp/money (or brick/money) for arithmetic, a first-party ExchangeRateProvider interface, a ported ECB adapter, and a cached rate table.

Migration path:

  1. Port the ECB fetcher into app/Services/Fx/EcbRateProvider.php implementing a local interface; use Laravel's Http client and SimpleXMLElement.
  2. Persist to a currency_rates table keyed (base, quote, rate, as_of, source).
  3. Bind the interface in a service provider; wrap reads in Cache::remember with a 15–60 minute TTL.
  4. Replace the Twig filters with Blade components plus a Money cast/accessor and a format() helper.
  5. Schedule fx:refresh-rates in routes/console.php for after ~16:00 CET on TARGET business days.

Compatibility: target PHP 8.2+ / Laravel 10–11. Retain zero Symfony2 artifacts. If a side-by-side evaluation is mandated, isolate the bundle behind an adapter and never let its Doctrine entity into the application schema.

Sequencing: (1) interface + fixed-rate table to unblock pricing work; (2) ECB adapter + scheduler; (3) Blade formatting layer; (4) multi-provider failover only if the SLA demands it.

Effort: roughly 2–4 dev-days for the port plus tests. The bundle itself saves perhaps half a day — a negative ROI once conflict resolution and review are counted.

Operational Impact

Maintenance: if vendored, you own it outright — no upstream fixes will arrive. If forked, budget ~0.5 day/quarter. If reimplemented as recommended, ~1 day/year. Note the repository shows no meaningful community activity, so "wait for upstream" is not a strategy.

Support: none. Single maintainer organization, no visible security disclosure process, 58 stars. Assume internal ownership from day one.

Scaling: compute cost is negligible. The only external dependency is the daily upstream fetch, so throughput is bounded by cache hit rate on the rate table — comfortably thousands of RPS with a 15-minute TTL and an in-memory/Redis cache.

Failure modes to design against:

  • ECB feed outage or format change → stale rates used silently. Mitigate with an as_of staleness guard, an alert at >48h, and fail-closed behavior on checkout pricing.
  • ECB publishes EUR-based rates only → missing pairs require triangulation via EUR, which compounds rounding error. Document the policy and test it.
  • Rounding drift in multi-step conversions → do all arithmetic in minor-unit integers; never chain float multiplications.
  • Weekend/holiday gaps are expected behavior, not incidents — the scheduler and alerting must model TARGET business days or on-call will be paged every Saturday.

Ramp-up: low. A mid-level Laravel engineer can complete the port in half a day. The review time belongs to domain nuance — rounding policy, triangulation, rate provenance — not to the code itself.

Verdict: extract the ECB provider, discard the rest. The package is a useful prior-art reference for FX plumbing and a poor production dependency for a Laravel application.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager