PHPackages                             amodar/laravel-swap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. amodar/laravel-swap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

amodar/laravel-swap
===================

Currency exchange rates library for Laravel and Lumen

2.0.1(6y ago)0556MITPHPPHP ^7.1.3

Since Jun 10Pushed 6y agoCompare

[ Source](https://github.com/Amodar/laravel-swap)[ Packagist](https://packagist.org/packages/amodar/laravel-swap)[ Docs](https://github.com/florianv/laravel-swap)[ RSS](/packages/amodar-laravel-swap/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (6)Versions (17)Used By (0)

Temp fork will archived once the florianv/laravel-swap supports Laravel 6
=========================================================================

[](#temp-fork-will-archived-once-the-florianvlaravel-swap-supports-laravel-6)

[![](https://camo.githubusercontent.com/e9f2edc0c4c1fdecc071323f862b779f03a21b1b4d83746b97fbf4e01f607ac9/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f737761702e6173736574732f737761705f6c6f676f2e706e67)](https://camo.githubusercontent.com/e9f2edc0c4c1fdecc071323f862b779f03a21b1b4d83746b97fbf4e01f607ac9/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f737761702e6173736574732f737761705f6c6f676f2e706e67) Laravel Swap
======================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-laravel-swap)

[![Build status](https://camo.githubusercontent.com/c1d89151e2632fa24dc094fc95880bbe05b451712cb33867340ff9899cb5915e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616d6f6461722f6c61726176656c2d737761702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/amodar/laravel-swap)

Swap allows you to retrieve currency exchange rates from various services such as **[Fixer](https://fixer.io)** or **[currencylayer](https://currencylayer.com)** and optionally cache the results.

QuickStart
----------

[](#quickstart)

### Installation

[](#installation)

```
$ composer require php-http/curl-client nyholm/psr7 php-http/message florianv/laravel-swap
```

### Laravel 5.5+

[](#laravel-55)

If you don't use auto-discovery, add the `ServiceProvider` to the providers array in `config/app.php`:

```
// /config/app.php
'providers' => [
    Swap\Laravel\SwapServiceProvider::class
],
```

If you want to use the facade to log messages, add this to your facades in app.php:

```
'aliases' => [
    'Swap' => Swap\Laravel\Facades\Swap::class
]

```

Copy the package config to your local config with the publish command:

```
$ php artisan vendor:publish --provider="Swap\Laravel\SwapServiceProvider"
```

### Lumen

[](#lumen)

Configure the Service Provider and alias:

```
// /boostrap/app.php

// Register the facade
$app->withFacades(true, [
    Swap\Laravel\Facades\Swap::class => 'Swap'
]);

// Load the configuration
$app->configure('swap');

// Register the service provider
$app->register(Swap\Laravel\SwapServiceProvider::class);
```

Copy the [configuration](config/swap.php) to `/config/swap.php` if you wish to override it.

Usage
-----

[](#usage)

```
// Get the latest EUR/USD rate
$rate = Swap::latest('EUR/USD');

// 1.129
$rate->getValue();

// 2016-08-26
$rate->getDate()->format('Y-m-d');

// Get the EUR/USD rate yesterday
$rate = Swap::historical('EUR/USD', Carbon\Carbon::yesterday());
```

Documentation
-------------

[](#documentation)

The complete documentation can be found [here](https://github.com/florianv/laravel-swap/blob/master/doc/readme.md).

Sponsors 😍
----------

[](#sponsors-heart_eyes)

We are proudly supported by the following echange rate providers offering *free plans up to 1,000 requests per day*:

[![](https://camo.githubusercontent.com/8ca444a24633a18b613b34304afdb3c6eb567477ab47fa409b2256b8b2b9db92/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f737761702e6173736574732f66697865725f69636f6e2e706e673f763d32)](https://camo.githubusercontent.com/8ca444a24633a18b613b34304afdb3c6eb567477ab47fa409b2256b8b2b9db92/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f737761702e6173736574732f66697865725f69636f6e2e706e673f763d32) **[Fixer](https://fixer.io)**

Fixer is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies. They provide real-time rates and historical data, however, EUR is the only available base currency on the free plan.

[![](https://camo.githubusercontent.com/077e83e24e837da81df47eb21cd4d2bfbc61879211243dc666314fc22108f918/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f737761702e6173736574732f63757272656e63796c617965725f69636f6e2e706e67)](https://camo.githubusercontent.com/077e83e24e837da81df47eb21cd4d2bfbc61879211243dc666314fc22108f918/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f737761702e6173736574732f63757272656e63796c617965725f69636f6e2e706e67) **[currencylayer](https://currencylayer.com)**

Currencylayer provides reliable exchange rates and currency conversions for your business up to 168 world currencies. They provide real-time rates and historical data, however, USD is the only available base currency on the free plan.

Services
--------

[](#services)

Here is the list of the currently implemented services:

ServiceBase CurrencyQuote CurrencyHistorical[Fixer](https://fixer.io)EUR (free, no SSL), \* (paid)\*Yes[currencylayer](https://currencylayer.com)USD (free), \* (paid)\*Yes[European Central Bank](https://www.ecb.europa.eu/home/html/index.en.html)EUR\*Yes[National Bank of Romania](http://www.bnr.ro)RON\*Yes[Central Bank of the Republic of Turkey](http://www.tcmb.gov.tr)\*TRYYes[Central Bank of the Czech Republic](https://www.cnb.cz)\*CZKYes[Central Bank of Russia](https://cbr.ru)\*RUBYes[WebserviceX](http://www.webservicex.net)\*\*No[1Forge](https://1forge.com)\* (free but limited or paid)\* (free but limited or paid)No[Cryptonator](https://www.cryptonator.com)\* Crypto (Limited standard currencies)\* Crypto (Limited standard currencies)No[CurrencyDataFeed](https://currencydatafeed.com)\* (free but limited or paid)\* (free but limited or paid)No[Open Exchange Rates](https://openexchangerates.org)USD (free), \* (paid)\*Yes[Xignite](https://www.xignite.com)\*\*Yes[Currency Converter API](https://www.currencyconverterapi.com)\*\*Yes (free but limited or paid)Array\*\*YesCredits
-------

[](#credits)

- [Florian Voutzinos](https://github.com/florianv)
- [All Contributors](https://github.com/florianv/laravel-swap/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](https://github.com/florianv/laravel-swap/blob/master/LICENSE) for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 81.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~110 days

Recently: every ~141 days

Total

15

Last Release

2440d ago

Major Versions

0.x-dev → 1.0.02016-10-09

1.x-dev → 2.0.02019-02-12

PHP version history (3 changes)v0.1.0PHP &gt;=5.5.9

1.0.0PHP ^5.5|^7.0

2.0.0PHP ^7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/42eb88eccfe1d8681ebabf14711535a106b2a9fbe7f0ef01da250064017a5086?d=identicon)[Amodar](/maintainers/Amodar)

---

Top Contributors

[![florianv](https://avatars.githubusercontent.com/u/1586668?v=4)](https://github.com/florianv "florianv (58 commits)")[![Amodar](https://avatars.githubusercontent.com/u/6911379?v=4)](https://github.com/Amodar "Amodar (7 commits)")[![denlapaev](https://avatars.githubusercontent.com/u/3096564?v=4)](https://github.com/denlapaev "denlapaev (1 commits)")[![mohammad6006](https://avatars.githubusercontent.com/u/553379?v=4)](https://github.com/mohammad6006 "mohammad6006 (1 commits)")[![Naoray](https://avatars.githubusercontent.com/u/10154100?v=4)](https://github.com/Naoray "Naoray (1 commits)")[![alies-dev](https://avatars.githubusercontent.com/u/5278175?v=4)](https://github.com/alies-dev "alies-dev (1 commits)")[![simplenotezy](https://avatars.githubusercontent.com/u/3786627?v=4)](https://github.com/simplenotezy "simplenotezy (1 commits)")[![arjanwestdorp](https://avatars.githubusercontent.com/u/7716654?v=4)](https://github.com/arjanwestdorp "arjanwestdorp (1 commits)")

---

Tags

laravelmoneycurrencylumenconversionRateexchange rates

### Embed Badge

![Health badge](/badges/amodar-laravel-swap/health.svg)

```
[![Health](https://phpackages.com/badges/amodar-laravel-swap/health.svg)](https://phpackages.com/packages/amodar-laravel-swap)
```

###  Alternatives

[florianv/laravel-swap

Currency exchange rates library for Laravel and Lumen

3342.0M2](/packages/florianv-laravel-swap)[florianv/swap

Exchange rates library for PHP

1.3k6.4M16](/packages/florianv-swap)[florianv/exchanger

Currency exchange rates framework for PHP

1874.7M15](/packages/florianv-exchanger)[torann/currency

This provides Laravel with currency functions such as currency formatting and conversion using up-to-date exchange rates.

4081.1M6](/packages/torann-currency)[florianv/swap-bundle

Integrates the Swap library with Symfony

62416.1k1](/packages/florianv-swap-bundle)[danielme85/laravel-cconverter

Laravel 5 plug-in for currency conversion

42101.1k](/packages/danielme85-laravel-cconverter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
