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

Swap Laravel Package

florianv/swap

PHP 8.2+ currency exchange rate library with a single API over 30+ providers. Supports conversion, historical rates, PSR-16 caching, and provider fallback. Works with PSR-18 HTTP clients and PSR-17 factories for flexible integrations.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Multi-currency e-commerce: Enable dynamic pricing, localized checkout flows, and currency conversion for global storefronts (e.g., Shopify, Magento, or custom Laravel-based platforms).
  • Fintech/ERP integrations: Power cross-border transactions, accounting systems, or FX dashboards with real-time/historical rates (e.g., invoicing, payroll, or reconciliation tools).
  • Build vs. Buy: Buy for rapid implementation (30+ providers, caching, and fallback logic pre-built). Build only if needing custom provider logic (use the underlying Exchanger library).
  • Roadmap priorities:
    • Phase 1: Integrate florianv/swap for core currency conversion needs (e.g., checkout, admin dashboards).
    • Phase 2: Extend with moneyphp/money integration for type-safe monetary calculations.
    • Phase 3: Explore historical rate analytics for reporting (e.g., "FX impact on revenue").
  • Use cases:
    • Real-time conversions: Display prices in user’s local currency (e.g., EUR → USD → JPY).
    • Batch processing: Convert large datasets (e.g., export invoices in multiple currencies).
    • Fallback resilience: Ensure uptime by chaining commercial (fastFOREX) + free (ECB) providers.

When to Consider This Package

Adopt if:

  • Your PHP app needs currency conversion with minimal boilerplate (30+ providers behind a unified API).
  • You require fallback logic (e.g., if fastFOREX fails, use ECB as backup).
  • Your use case involves historical rates (e.g., auditing past transactions) or cryptocurrencies (e.g., crypto payment gateways).
  • You’re using Laravel/Symfony and want seamless integration (via laravel-swap/symfony-swap).
  • Your team lacks FX infrastructure expertise—this abstracts provider complexity.

Look elsewhere if:

  • You need ultra-low latency (e.g., high-frequency trading): Use a direct provider API (e.g., fastFOREX’s native SDK).
  • You’re not using PHP 8.2+: The package drops support for older versions.
  • You require custom rate calculations (e.g., margin-based conversions): Extend the underlying Exchanger library instead.
  • Your budget is < $18/month and you need non-EUR base pairs at scale: Free providers (e.g., ECB) are limited to EUR-based rates.

How to Pitch It (Stakeholders)

For Executives: *"Swap is a turnkey solution to eliminate FX conversion headaches in our global products. By integrating this PHP library, we’ll:

  • Reduce dev time by 80% vs. building a custom FX service (30+ providers pre-integrated).
  • Improve reliability with automatic fallbacks (e.g., if our paid provider fails, it uses free sources like the ECB).
  • Future-proof our multi-currency features with historical rate tracking and crypto support. Cost: ~$0 (MIT license) + $18/month for premium rates (optional). ROI: Faster launches, fewer bugs, and scalability for international markets."*

For Engineers: *"Swap gives us a batteries-included FX layer with:

  • Unified API: Fetch rates from fastFOREX, ECB, or custom sources via a single interface.
  • Caching: PSR-16 compliant (works with Redis, file cache, etc.) to avoid rate-limit issues.
  • Fallback chain: If Provider A fails, it silently retries Provider B (configurable in code).
  • Laravel/Symfony ready: Official packages exist for both frameworks. Tradeoff: We cede some control over HTTP plumbing (uses PSR-18), but the abstraction saves weeks of dev work. For edge cases (e.g., custom rate logic), we can drop down to the Exchanger library."*
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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
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