PHPackages                             finller/laravel-forex - 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. finller/laravel-forex

Abandoned → [elegantly/laravel-forex](/?search=elegantly%2Flaravel-forex)Library

finller/laravel-forex
=====================

Forex for Laravel

v2.5.0(1mo ago)42.4kMITPHPPHP ^8.1CI passing

Since Mar 3Pushed 1mo agoCompare

[ Source](https://github.com/ElegantEngineeringTech/laravel-forex)[ Packagist](https://packagist.org/packages/finller/laravel-forex)[ Docs](https://github.com/ElegantEngineeringTech/laravel-forex)[ GitHub Sponsors](https://github.com/ElegantEngineeringTech)[ RSS](/packages/finller-laravel-forex/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (34)Versions (24)Used By (0)

Laravel Forex
=============

[](#laravel-forex)

[![Latest Version on Packagist](https://camo.githubusercontent.com/52a6e9cb4e980fbb8c172eb869915b1d1d15f11e9ebd7923659e7800f152af23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c6567616e746c792f6c61726176656c2d666f7265782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elegantly/laravel-forex)[![Tests](https://camo.githubusercontent.com/ef33bc62408d3f83e5e1f4cc408aca03aed2cba73f295cac7bbadf8c7904c79d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f456c6567616e74456e67696e656572696e67546563682f6c61726176656c2d666f7265782f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/ElegantEngineeringTech/laravel-forex/actions?query=workflow%3Arun-tests+branch%3Amain)[![Code Style](https://camo.githubusercontent.com/780479b186b48cec96fc87377c5669101738a44271c11a1c2968d446bc0f9356/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f456c6567616e74456e67696e656572696e67546563682f6c61726176656c2d666f7265782f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/ElegantEngineeringTech/laravel-forex/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![PHPStan Level](https://camo.githubusercontent.com/2fb7c568f7b0b5edd159c1c642ddc45389f5f94ebe4970b31130b2ec41cb3cb8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f456c6567616e74456e67696e656572696e67546563682f6c61726176656c2d666f7265782f7068707374616e2e796d6c3f6c6162656c3d7068707374616e267374796c653d666c61742d737175617265)](https://github.com/ElegantEngineeringTech/laravel-forex/actions?query=workflow%3Aphpstan)[![Laravel Pint](https://camo.githubusercontent.com/51f1a737dd8216f5f42db185754319df94a9bfd7e1385e637da2d55c62bf13fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f456c6567616e74456e67696e656572696e67546563682f6c61726176656c2d666f7265782f70696e742e796d6c3f6c6162656c3d6c61726176656c25323070696e74267374796c653d666c61742d737175617265)](https://github.com/ElegantEngineeringTech/laravel-forex/actions?query=workflow%3Apint)[![Total Downloads](https://camo.githubusercontent.com/1d59bf0f073c00ea8aa0a6069f08ae878679eefceddb315c7550778bd450eaa0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c6567616e746c792f6c61726176656c2d666f7265782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elegantly/laravel-forex)

**Laravel Forex** is a simple and flexible package for retrieving the latest and historical foreign exchange rates in your Laravel application.

By default, it uses the free tier from [exchangerate-api.com](https://www.exchangerate-api.com/), but you can easily configure it to use any other Forex provider.

---

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

[](#installation)

Install via Composer:

```
composer require elegantly/laravel-forex
```

Publish the configuration file:

```
php artisan vendor:publish --tag="forex-config"
```

---

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

[](#configuration)

Here’s the default configuration that will be published to `config/forex.php`:

```
use Elegantly\Forex\Integrations\ExchangeRateApiFree\ExchangeRateApiFreeConnector;

return [

    'cache' => [
        'enabled' => true,
        'driver' => env('FOREX_CACHE_DRIVER', env('CACHE_STORE', env('CACHE_DRIVER', 'file'))),
        'expiry_seconds' => 86_400, // 1 day
    ],

    'rate_limit' => [
        'enabled' => false,
        'driver' => env('FOREX_RATE_LIMIT_DRIVER', env('CACHE_STORE', env('CACHE_DRIVER', 'file'))),
        'every_seconds' => 3_600, // 1 hour
    ],

    'client' => ExchangeRateApiFreeConnector::class,

    'clients' => [
        'exchange-rate-api' => [
            'token' => env('EXCHANGE_RATE_API_TOKEN'),
        ],
    ],

];
```

---

Usage
-----

[](#usage)

### Get Latest Rates

[](#get-latest-rates)

```
use Elegantly\Forex\Facades\Forex;

$rates = Forex::latest('USD');

$usdToEur = $rates['EUR'];
```

### Get Historical Rates

[](#get-historical-rates)

```
use Carbon\Carbon;
use Elegantly\Forex\Facades\Forex;

$rates = Forex::rates(Carbon::create(2022, 4, 25), 'USD');

$usdToEur = $rates['EUR'];
```

### Convert Money Between Currencies

[](#convert-money-between-currencies)

You can easily convert a `Money` instance from one currency to another using the `Forex::convert()` method.

This method ensures high-precision conversions by leveraging the [`brick/money`](https://github.com/brick/money) PHP library.

```
use Elegantly\Forex\Facades\Forex;
use Brick\Money\Money;

$convertedMoney = Forex::convert(
    money: Money::of(100, 'USD'),
    currency: 'EUR',
);

$convertedMoney->__toString(); // (EUR) 88.84
```

**Note:** The returned value is a `Money` object representing the amount in the target currency.

---

Testing
-------

[](#testing)

Run the test suite with:

```
composer test
```

---

Changelog
---------

[](#changelog)

See the [CHANGELOG](CHANGELOG.md) for details on recent updates.

---

Contributing
------------

[](#contributing)

Contributions are welcome! Please read the [CONTRIBUTING](CONTRIBUTING.md) guide for details.

---

Security
--------

[](#security)

If you discover any security-related issues, please refer to our [security policy](../../security/policy).

---

Credits
-------

[](#credits)

- [Quentin Gabriele](https://github.com/QuentinGab)
- [All Contributors](../../contributors)

---

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](LICENSE.md).

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance92

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 71.8% 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 ~38 days

Recently: every ~80 days

Total

21

Last Release

40d ago

Major Versions

v1.2.0 → v2.0.02025-04-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/d769563728757858e249f266ac2555f28db5640124df92821ed17d93ee76fc7b?d=identicon)[QuentinGab](/maintainers/QuentinGab)

---

Top Contributors

[![QuentinGab](https://avatars.githubusercontent.com/u/40128136?v=4)](https://github.com/QuentinGab "QuentinGab (61 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")

---

Tags

exchange-ratesforexlaravellaravel-packagelaravelElegantlylaravel-forex

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/finller-laravel-forex/health.svg)

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

###  Alternatives

[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.1k](/packages/codebar-ag-laravel-zammad)[elegantly/laravel-invoices

Store invoices safely in your Laravel application

23131.8k](/packages/elegantly-laravel-invoices)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[elegantly/laravel-translator

All on one translations management for Laravel

6216.9k](/packages/elegantly-laravel-translator)

PHPackages © 2026

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