PHPackages                             juanparati/laravel-exchanger - 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. juanparati/laravel-exchanger

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

juanparati/laravel-exchanger
============================

A currency exchange rate library for Laravel

12.0(1y ago)03.4k↓33.3%MITPHPPHP &gt;=8.2

Since Dec 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/juanparati/laravel-exchanger)[ Packagist](https://packagist.org/packages/juanparati/laravel-exchanger)[ RSS](/packages/juanparati-laravel-exchanger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (9)Used By (0)

[![](https://camo.githubusercontent.com/5e30a0524551e952540eb6b456b17bf14a34f5df7e1009128768010912853366/68747470733a2f2f6170692e7472617669732d63692e636f6d2f6a75616e7061726174692f6c61726176656c2d65786368616e6765722e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/5e30a0524551e952540eb6b456b17bf14a34f5df7e1009128768010912853366/68747470733a2f2f6170692e7472617669732d63692e636f6d2f6a75616e7061726174692f6c61726176656c2d65786368616e6765722e7376673f6272616e63683d6d6173746572)

Laravel-Exchanger
=================

[](#laravel-exchanger)

A Laravel currency converter library that uses [florianv/exchanger](https://github.com/florianv/exchanger).

Installation
------------

[](#installation)

```
composer require juanparati/laravel-exchanger

```

Facade registration (optional):

```
'aliases' => [
    ...
    'CurrencyExchanger' => \Juanparati\LaravelExchanger\Facades\ExchangerConverterFacade,
    ...
]

```

Configuration
-------------

[](#configuration)

Publish configuration file:

```
artisan vendor:publish --provider="Juanparati\LaravelExchanger\Providers\ExchangerServiceProvider"

```

The configuration contains a list of services, check the [florianv/exchanger](https://github.com/florianv/exchanger) documentation in order to know the description and characteristics of each service.

It's important to provide a valid cache time (in seconds) in order to avoid duplicate requests.

Usage
-----

[](#usage)

### Get the currency rate

[](#get-the-currency-rate)

```
$rate = CurrencyExchanger::getRate('eur', 'pln'); // Return Exchanger\ExchangeRate
$rate->getValue();                                // Returns rate as float
$rate->getDate()->format('Y-m-d')                 // Returns exchange date

// Historical rate
CurrencyExchanger::getRate('nok', 'sek', now()->subDays(10));

```

### Convert currency

[](#convert-currency)

```
CurrencyExchanger::convert('ron', 'dkk', 10); // Convert 10 RON to DKK and return as float

// Historical conversion rate
CurrencyExchanger::convert('ron', 'dkk', 10, now()->subDays(5));

// Obtain the last rate (Exchanger\ExchangeRate) for the previous currency conversion
CurrencyExchanger::getLastExchangeRateResult();

```

### Cache state

[](#cache-state)

Is sometimes convenient to disable the cache in order of force to request the most recent rate or conversion. In order to achieve that is possible to disable temporally the cache:

```
CurrencyExchanger::setCacheStatus(false); // Cache disabled
CurrencyExchanger::setCacheStatus(true);  // Cache enabled

```

Remember that cache is always enabled by default when the configuration key "cache\_time" has a valid integer.

### Attach/Detach services on-demand

[](#attachdetach-services-on-demand)

It's possible to attach and detach services on demand:

```
// Detach service
CurrencyExchanger::detach(\Exchanger\Service\Cryptonator::class);

// Attach service
CurrencyExchanger::attach(\Exchanger\Service\Cryptonator::class);

```

By default all the services registered into the configuration are attached by default.

### Execute custom queries

[](#execute-custom-queries)

Because this library works as a wrapper for [florianv/exchanger](https://github.com/florianv/exchanger) it's possible to execute custom queries passing the build query to the "executeQuery" method.

```
...
CurrencyExchanger::executeQuery($query->build);
...

```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance44

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~219 days

Recently: every ~161 days

Total

8

Last Release

441d ago

Major Versions

1.1 → 2.02022-06-09

2.0 → 3.02022-11-23

3.0 → 4.02023-05-23

4.0 → 11.x-dev2024-04-17

11.1 → 12.x-dev2025-02-25

PHP version history (3 changes)1.1PHP &gt;=7.3

3.0PHP &gt;=8.0

11.x-devPHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4caf72b4d969cfb8cdfbdc1d594c85b51c9316caf76b80aa0f9de7e3736cf59f?d=identicon)[juanparati](/maintainers/juanparati)

---

Top Contributors

[![juanparati](https://avatars.githubusercontent.com/u/835173?v=4)](https://github.com/juanparati "juanparati (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/juanparati-laravel-exchanger/health.svg)

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

###  Alternatives

[laravolt/avatar

Turn name, email, and any other string into initial-based avatar or gravatar.

2.0k5.4M31](/packages/laravolt-avatar)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[anlutro/l4-settings

Persistent settings in Laravel.

9312.4M19](/packages/anlutro-l4-settings)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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