Weave Code
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

Exchanger Laravel Package

florianv/exchanger

PHP exchange-rate provider layer with 31 services behind one ExchangeRateService interface. Supports historical rates, PSR-16 caching, and chainable fallback across providers (commercial APIs, ECB, national banks, exchangerate.host) for fine-grained control.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Buy – Avoid reinventing the wheel for currency conversion logic, API integrations, and fallback mechanisms. This package eliminates the need to build and maintain a custom exchange rate service layer.
  • Feature Expansion: Enable real-time and historical currency conversion across 31+ providers (including commercial APIs like fastFOREX and public sources like the European Central Bank) with minimal integration effort.
  • Reliability & Resilience: Implement chained fallback logic to ensure uninterrupted service if a primary provider fails, improving uptime for financial applications.
  • Performance Optimization: Leverage PSR-16 caching to reduce API calls and latency, critical for high-traffic platforms (e.g., e-commerce, fintech).
  • Multi-Currency Support: Expand product offerings (e.g., global checkout, cross-border payments) by supporting 160+ currencies and 500+ cryptocurrencies via a unified interface.
  • Compliance & Auditability: Track exchange rates by provider (getProviderName()) for transparency in financial reporting or regulatory requirements.
  • Framework Agnosticism: Integrate seamlessly into Laravel, Symfony, or custom PHP without vendor lock-in, using the underlying Swap library for higher-level needs.
  • Cost Efficiency: Use free tiers (e.g., European Central Bank) for non-critical paths or low-volume use cases, with paid upgrades (e.g., fastFOREX) for high-availability needs.

When to Consider This Package

  • Adopt if:

    • You need fine-grained control over exchange rate providers (e.g., custom middleware, HTTP layers, or caching strategies).
    • Your application requires fallback chains (e.g., primary commercial API + secondary public provider).
    • You’re building a currency conversion facade or framework integration (e.g., for Laravel/Symfony).
    • You need historical rate queries or multi-currency support beyond basic USD/EUR pairs.
    • Your team lacks bandwidth to maintain 30+ API integrations or handle rate-limiting/retries.
  • Look elsewhere if:

    • You only need simple USD/EUR conversions → Use the higher-level Swap library (built on Exchanger).
    • Your stack is not PHP 8.2+ → This package enforces strict PHP version requirements.
    • You require blockchain-specific rates → Consider dedicated crypto APIs (e.g., CoinGecko, CoinMarketCap).
    • You need real-time streaming → Exchanger is request-based; explore WebSocket APIs for live updates.
    • Your use case is non-financial (e.g., unit conversion) → A lightweight custom solution may suffice.

How to Pitch It (Stakeholders)

For Executives:

"Exchanger is a turnkey solution to eliminate technical debt in currency conversion—integrating 31+ exchange rate providers (including free and paid tiers) behind a single, resilient interface. It reduces API costs via caching, ensures uptime with fallback chains, and supports global scaling (160+ currencies, 500+ cryptos). For $18/month, we can sponsor fastFOREX’s premium tier for real-time reliability, while free tiers cover basic needs. This cuts dev time by 80% compared to building in-house, and the MIT license avoids licensing risks."

Key Outcomes:

  • Reduce API costs (caching + fallback logic).
  • Scale globally without per-currency integration work.
  • Future-proof with support for new providers (e.g., crypto, emerging markets).

For Engineering:

*"Exchanger provides a PSR-compliant, chainable exchange rate layer with:

  • 31 providers (commercial + public) under a unified ExchangeRateService interface.
  • Fallback chains: If fastFOREX fails, it auto-falls back to the European Central Bank or other services.
  • PSR-16 caching: Plug into Symfony Cache, Redis, or any PSR-16-compliant store.
  • Historical rates: Query past exchange rates for auditing or analytics.
  • Extensible: Add custom providers by implementing ExchangeRateService or wrap services with middleware (e.g., rate limiting).

Why not build it?

  • Avoid maintaining 30+ API clients, rate-limiting logic, and fallback orchestration.
  • Leverage battle-tested HTTP clients (PSR-18) and caching strategies.
  • Integrates with Swap for higher-level needs (e.g., currency formatting, locale support).

Trade-offs:

  • PHP 8.2+ required (aligns with Laravel/Symfony 10+).
  • For simple use cases, prefer Swap (this is the low-level layer it’s built on)."*

Proposed Implementation:

  1. Phase 1: Replace ad-hoc API calls with Exchanger’s Chain (e.g., fastFOREX → ECB fallback).
  2. Phase 2: Add PSR-16 caching (e.g., Redis) to reduce API calls.
  3. Phase 3: Extend for historical queries or custom providers if needed.
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai