PHPackages                             ashallendesign/laravel-exchange-rates - 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. [API Development](/categories/api)
4. /
5. ashallendesign/laravel-exchange-rates

ActiveLibrary[API Development](/categories/api)

ashallendesign/laravel-exchange-rates
=====================================

A wrapper package for interacting with the exchangeratesapi.io API.

v7.11.0(2mo ago)485677.8k—2.7%54MITPHPPHP ^8.2CI failing

Since Nov 25Pushed 2mo ago7 watchersCompare

[ Source](https://github.com/ash-jc-allen/laravel-exchange-rates)[ Packagist](https://packagist.org/packages/ashallendesign/laravel-exchange-rates)[ Docs](https://github.com/ash-jc-allen/laravel-exchange-rates)[ GitHub Sponsors](https://github.com/ash-jc-allen)[ RSS](/packages/ashallendesign-laravel-exchange-rates/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (44)Used By (0)

[![Laravel Exchange Rates](https://camo.githubusercontent.com/775bf4dd462bfd9b3f25e9e6a7ae0ae948911e77b693331ec9f47bf3977d977e/68747470733a2f2f617368616c6c656e64657369676e2e636f2e756b2f696d616765732f637573746f6d2f6c61726176656c2d65786368616e67652d72617465732d6c6f676f2e706e67)](https://camo.githubusercontent.com/775bf4dd462bfd9b3f25e9e6a7ae0ae948911e77b693331ec9f47bf3977d977e/68747470733a2f2f617368616c6c656e64657369676e2e636f2e756b2f696d616765732f637573746f6d2f6c61726176656c2d65786368616e67652d72617465732d6c6f676f2e706e67)

[![Latest Version on Packagist](https://camo.githubusercontent.com/50b3b73978e6265f4fe0002b049f89acbd76410428a3e61e3a0d8935d1b9a9e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617368616c6c656e64657369676e2f6c61726176656c2d65786368616e67652d72617465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashallendesign/laravel-exchange-rates)[![Total Downloads](https://camo.githubusercontent.com/d0bfe1acd03571bbd866422cf4c63f8eb9d3e56737e9bead411793309377bd7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617368616c6c656e64657369676e2f6c61726176656c2d65786368616e67652d72617465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashallendesign/laravel-exchange-rates)[![PHP from Packagist](https://camo.githubusercontent.com/8824eadae178b1ae231e6d56f1400394a16591462c6dab948e53ddd447f0e79b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f617368616c6c656e64657369676e2f6c61726176656c2d65786368616e67652d72617465733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ashallendesign/laravel-exchange-rates)[![GitHub license](https://camo.githubusercontent.com/bae1da0aba544256b9083286e95974d0802e23349359c69308ad36bd770470da/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6173682d6a632d616c6c656e2f6c61726176656c2d65786368616e67652d72617465733f7374796c653d666c61742d737175617265)](https://github.com/ash-jc-allen/short-url/blob/master/LICENSE)

Table of Contents
-----------------

[](#table-of-contents)

- [Overview](#overview)
- [Installation](#installation)
- [Supported APIs](#supported-apis)
- [Configuration](#configuration)
- [Usage](#usage)
    - [Methods](#methods)
        - [Available Currencies](#available-currencies)
        - [Exchange Rate](#exchange-rate)
            - [Getting the Rate Between Two Currencies](#getting-the-rate-between-two-currencies)
            - [Getting the Rate Between More Than Two Currencies](#getting-the-rate-between-more-than-two-currencies)
        - [Exchange Rates Between Date Range](#exchange-rates-between-date-range)
            - [Getting the Rates Between Two Currencies](#getting-the-rates-between-two-currencies)
            - [Getting the Rates Between More Than Two Currencies](#getting-the-rates-between-more-than-two-currencies)
        - [Convert Currencies](#convert-currencies)
            - [Converting Between Two Currencies](#converting-between-two-currencies)
            - [Converting Between More Than Two Currencies](#converting-between-more-than-two-currencies)
        - [Convert Currencies Between Date Range](#convert-currencies-between-date-range)
            - [Converting Between Two Currencies in a Date Range](#converting-between-two-currencies-in-a-date-range)
            - [Converting Between More Than Two Currencies in a Date Range](#converting-between-more-than-two-currencies-in-a-date-range)
    - [Facade](#facade)
    - [Drivers](#drivers)
        - [Available Drivers](#available-drivers)
    - [Validation Rule](#validation-rule)
    - [Caching](#caching)
        - [Busting Cached Exchange Rates](#busting-cached-exchange-rates)
        - [Preventing Exchange Rates from Being Cached](#preventing-exchange-rates-from-being-cached)
    - [Supported Currencies](#supported-currencies)
- [Testing](#testing)
- [Security](#security)
- [Contribution](#contribution)
- [Credits](#credits)
- [Changelog](#changelog)
- [Upgrading](#upgrading)
- [License](#license)

Overview
--------

[](#overview)

A simple Laravel package used for interacting with exchange rates APIs. Laravel Exchange Rates allows you to get the latest or historical exchange rates and convert monetary values between different currencies.

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

[](#installation)

You can install the package via Composer:

```
composer require ashallendesign/laravel-exchange-rates
```

The package has been developed and tested to work with the following minimum requirements:

- PHP 8.2
- Laravel 9

Supported APIs
--------------

[](#supported-apis)

Laravel Exchange Rates currently supports the following APIs:

- [Exchange Rates API](https://exchangeratesapi.io/?fpr=ashley37)
- [Exchange Rates Data API](https://apilayer.com/marketplace/exchangerates_data-api?fpr=ashley37)
- [Exchange Rate Host](https://exchangerate.host/)
- [CurrencyBeacon](https://currencybeacon.com/)

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

[](#configuration)

### Publish the Config File

[](#publish-the-config-file)

You can publish the package's config file using the following command:

```
php artisan vendor:publish --provider="AshAllenDesign\LaravelExchangeRates\Providers\ExchangeRatesProvider"
```

If you're using an API that requires an API key, you can put it in your `.env`:

```
EXCHANGE_RATES_API_KEY={Your-API-Key-Here}
```

If you're using the free tier of `https://exchangeratesapi.io` or `https://exchangerate.host`, you should set the `https` config option in `config/laravel-exchange-rates.php` to `false`, as the free tiers of those APIs don't allow HTTPS requests.

Usage
-----

[](#usage)

### Methods

[](#methods)

#### Available Currencies

[](#available-currencies)

To get the available currencies supported by the API, you can use the `currencies` method like so:

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$exchangeRates->currencies();
```

#### Exchange Rate

[](#exchange-rate)

##### Getting the Rate Between Two Currencies

[](#getting-the-rate-between-two-currencies)

To get the exchange rate for one currency to another, you can use the `exchangeRate` method. When doing this, you can pass the currency code as a string as the second parameter. The `exchangeRate` method will then return a float containing the exchange rate.

The example below shows how to get the exchange rate from 'GBP' to 'EUR' for today.

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$result = $exchangeRates->exchangeRate('GBP', 'EUR');

// $result: 1.10086
```

Note: If a Carbon date is passed as the third parameter, the exchange rate for that day will be returned (if valid). If no date is passed, today's exchange rate will be used.

##### Getting the Rate Between More Than Two Currencies

[](#getting-the-rate-between-more-than-two-currencies)

It's possible to get the exchange rates for multiple currencies in one call. This can be particularly useful if you are needing to get many exchange rates at once and don't want to make multiple API calls.

To do this, you can use `exchangeRate` method and pass an array of currency code strings as the second parameter. This will return an array containing the exchange rates as floats.

The example below shows how to get the exchange rates from 'GBP' to 'EUR' and 'USD' for today:

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$result = $exchangeRates->exchangeRate('GBP', ['EUR', 'USD']);

// $result: [
//     'EUR' => 1.10086,
//     'USD' => 1.25622,
// ];
```

#### Exchange Rates Between Date Range

[](#exchange-rates-between-date-range)

##### Getting the Rates Between Two Currencies

[](#getting-the-rates-between-two-currencies)

To get the exchange rates between two currencies between a given date range, you can use the `exchangeRateBetweenDateRange` method. When doing this, you can pass the currency code as a string as the second parameter. The method will then return an array containing the exchange rates.

The example below shows how to get the exchange rates from 'GBP' to 'EUR' for the past 3 days:

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$result = $exchangeRates->exchangeRateBetweenDateRange(
    'GBP',
    'EUR',
    Carbon::now()->subWeek(),
    Carbon::now()
);

// $result: [
//     '2020-07-07' => 1.1092623405
//     '2020-07-08' => 1.1120625424
//     '2020-07-09' => 1.1153867604
// ];
```

##### Getting the Rates Between More Than Two Currencies

[](#getting-the-rates-between-more-than-two-currencies)

To get the exchange rates for multiple currencies in one call, you can pass an array of currency codes strings as the second parameter to the `exchangeRateBetweenDateRange` method.

The example below shows how to get the exchange rates from 'GBP' to 'EUR' and 'USD' for the past 3 days.:

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$result = $exchangeRates->exchangeRateBetweenDateRange(
    'GBP',
    ['EUR', 'USD'],
    Carbon::now()->subDays(3),
    Carbon::now()
);

// $result: [
//     '2020-07-07' => [
//         'EUR' => 1.1092623405,
//         'USD' => 1.2523571825,
//      ],
//     '2020-07-08' => [
//         'EUR' => 1.1120625424,
//         'USD' => 1.2550737853,
//      ],
//     '2020-07-09' => [
//         'EUR' => 1.1153867604,
//         'USD' => 1.2650716636,
//      ],
// ];
```

#### Convert Currencies

[](#convert-currencies)

When passing in the monetary value (first parameter) that is to be converted, it's important that you pass it in the lowest denomination of that currency. For example, £1 GBP would be passed in as 100 (as £1 = 100 pence).

##### Converting Between Two Currencies

[](#converting-between-two-currencies)

Similar to how you can get the exchange rate from one currency to another, you can also convert a monetary value from one currency to another. To do this you can use the `convert()` method.

The example below shows how to convert £1 'GBP' to 'EUR' at today's exchange rate:

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$result = $exchangeRates->convert(100, 'GBP', 'EUR', Carbon::now());

// $result: 110.15884906
```

Note: If a Carbon date is passed as the third parameter, the exchange rate for that day will be returned (if valid). If no date is passed, today's exchange rate will be used.

##### Converting Between More Than Two Currencies

[](#converting-between-more-than-two-currencies)

You can also use the `convert()` method to convert a monetary value from one currency to multiple currencies. To do this, you can pass an array of currency code strings as the third parameter.

The example below show how to convert £1 'GBP' to 'EUR' and 'USD' at today's exchange rate.

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$result = $exchangeRates->convert(
    100,
    'GBP',
    ['EUR', 'USD'],
    Carbon::now()
);

// $result: [
//     'EUR' => 110.15884906,
//     'USD' => 125.30569081
// ];
```

#### Convert Currencies Between Date Range

[](#convert-currencies-between-date-range)

When passing in the monetary value (first parameter) that is to be converted, it's important that you pass it in the lowest denomination of that currency. For example, £1 GBP would be passed in as 100 (as £1 = 100 pence).

##### Converting Between Two Currencies in a Date Range

[](#converting-between-two-currencies-in-a-date-range)

Similar to getting the exchange rates between a date range, you can also get convert monetary values from one currency to another using the exchange rates. To do this you can use the `convertBetweenDateRange` method.

The example below shows how to convert £1 'GBP' to 'EUR' using the exchange rates for the past 3 days:

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$exchangeRates->convertBetweenDateRange(
    100,
    'GBP',
    'EUR',
    Carbon::now()->subDays(3),
    Carbon::now()
);

// $result: [
//     '2020-07-07' => 110.92623405,
//     '2020-07-08' => 111.20625424,
//     '2020-07-09' => 111.53867604,
// ];
```

##### Converting Between More Than Two Currencies in a Date Range

[](#converting-between-more-than-two-currencies-in-a-date-range)

You can also use the `convertBetweenDateRange` method to convert a monetary value from one currency to multiple currencies using the exchange rates between a date range. To do this, you can pass an array of currency codes strings as the third parameter.

The example below show how to convert £1 'GBP' to 'EUR' and 'USD' at the past three days' exchange rates.

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$result = $exchangeRates->exchangeRateBetweenDateRange(
    'GBP',
    ['EUR', 'USD'],
    Carbon::now()->subDays(3),
    Carbon::now()
);

// $result: [
//     '2020-07-07' => [
//         'EUR' => 110.92623405,
//         'USD' => 125.23571825,
//      ],
//     '2020-07-08' => [
//         'EUR' => 111.20625424,
//         'USD' => 125.50737853,
//      ],
//     '2020-07-09' => [
//         'EUR' => 111.53867604,
//         'USD' => 126.50716636,
//      ],
// ];
```

### Facade

[](#facade)

If you prefer to use facades in Laravel, you can choose to use the provided `AshAllenDesign\LaravelExchangeRates\Facades\ExchangeRate` facade instead of instantiating the `AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate` class manually.

The example below shows an example of how you could use the facade to get the available currencies:

```
use AshAllenDesign\LaravelExchangeRates\Facades\ExchangeRate;

ExchangeRate::currencies();
```

### Drivers

[](#drivers)

Laravel Exchange Rates provides multiple drivers so that you can interact with different exchange rate APIs.

You can select the default driver that you want to use by setting the `driver` config field in the `config/laravel-exchange-rates.php` config file. For example, to use the `exchange-rates-api-io` driver, you could set the following:

```
'driver' => 'exchange-rates-api-io',
```

This driver will automatically be used when running methods such as:

```
// Using the "ExchangeRate" class:
$exchangeRates = app(ExchangeRate::class);
$result = $exchangeRates->exchangeRate('GBP', ['EUR', 'USD']);

// Using the "ExchangeRate" facade:
ExchangeRate::exchangeRate('GBP', ['EUR', 'USD']);
```

However, if you wish to use a different driver, you can use the `driver` method to specify the driver that you want to use. For example, to use the `exchange-rates-data-api` driver, you could use the following:

```
// Using the "ExchangeRate" class:
$exchangeRates = app(ExchangeRate::class);

$result = $exchangeRates
    ->driver('exchange-rates-data-api')
    ->exchangeRate('GBP', ['EUR', 'USD']);

// Using the "ExchangeRate" facade:
ExchangeRate::driver('exchange-rates-data-api')
    ->exchangeRate('GBP', ['EUR', 'USD']);
```

#### Available Drivers

[](#available-drivers)

The following drivers are available with the package:

API ServiceDriver nameAPI URLExchange Rates API IO`exchange-rates-api-io`[https://exchangeratesapi.io](https://exchangeratesapi.io/?fpr=ashley37)Exchange Rates Data API`exchange-rates-data-api`[https://apilayer.com/marketplace/exchangerates\_data-api](https://apilayer.com/marketplace/exchangerates_data-api?fpr=ashley37)Exchange Rate Host`exchange-rate-host`CurrencyBeacon`currency-beacon`### Validation Rule

[](#validation-rule)

Laravel Exchange Rates comes with its own `ValidCurrency` rule for validating currencies. This can be useful for if you need to be sure that a currency (maybe one provided by the user) is supported by at least one driver. The example below show how you can use the rule for validating the currency.

```
use AshAllenDesign\LaravelExchangeRates\Rules\ValidCurrency;
use Illuminate\Support\Facades\Validator;

$formData = [
    'currency' => 'GBP',
];

$rules = [
    'currency' => new ValidCurrency(),
];

$validator = Validator::make($formData, $rules);
```

This rule doesn't make a call to any APIs and instead checks an array (provided by the package) of all the currencies that are supported by at least one driver. This means that the rule will be much faster and won't cause issues with rate limits. However, it's possible that the rule may "pass" for a currency that is not supported by the driver that you are using.

If you'd prefer the validation to be stricter and return only the currencies supported by your chosen driver, you may want to write your own validation rule that makes a call to the API to get a list of supported currencies.

### Caching

[](#caching)

#### Busting Cached Exchange Rates

[](#busting-cached-exchange-rates)

By default, all responses from the exchange rates APIs are cached. This allows for significant performance improvements and reduced bandwidth from your server.

However, if for any reason you require a fresh result from the API and not a cached result, the `shouldBustCache` method can be used. The example below shows how to ignore the cached value (if one exists) and make a new API request:

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$exchangeRates->shouldBustCache()
    ->convert(
        100,
        'GBP',
        'EUR',
        Carbon::now()
);
```

#### Preventing Exchange Rates from Being Cached

[](#preventing-exchange-rates-from-being-cached)

It's also possible to prevent the exchange rates from being cached at all. To do this, you can use the `shouldCache(false)`method. The example below shows how to get an exchange rate and not cache it:

```
use AshAllenDesign\LaravelExchangeRates\Classes\ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$exchangeRates->shouldCache(false)
    ->convert(
        100,
        'GBP',
        'EUR',
        Carbon::now()
    );
```

Note: The caching works by storing exchange rates after fetching them from the API. As an example, if you were to fetch the exchange rates for 'GBP' to 'EUR' for 20-11-2019 - 27-11-2019, the rates between these dates will be cached as a single cache item. This cache item will only be retrieved if you attempt to fetch the same exchange rates on with the exact same currencies and date range.

Therefore, if you were to try and get 'GBP' to 'EUR' for 20-11-2019 - 26-11-2019, a new API request would be made because the date range is different.

### Supported Currencies

[](#supported-currencies)

Laravel Exchange Rates supports working with the following currencies (sorted in A-Z order):

CodeCurrency NameAEDUnited Arab Emirates DirhamAFNAfghan AfghaniALLAlbanian LekAMDArmenian DramANGNetherlands Antillean GuilderAOAAngolan KwanzaARSArgentine PesoAUDAustralian DollarAWGAruban FlorinAZNAzerbaijani ManatBAMBosnia-Herzegovina Convertible MarkBBDBarbadian DollarBDTBangladeshi TakaBGNBulgarian LevBHDBahraini DinarBIFBurundian FrancBMDBermudan DollarBNDBrunei DollarBOBBolivian BolivianoBRLBrazilian RealBSDBahamian DollarBTCBitcoinBTNBhutanese NgultrumBWPBotswanan PulaBYRBelarusian RubleBZDBelize DollarCADCanadian DollarCDFCongolese FrancCHFSwiss FrancCLFChilean Unit of Account (UF)CLPChilean PesoCNYChinese YuanCOPColombian PesoCRCCosta Rican ColónCUCCuban Convertible PesoCUPCuban PesoCVECape Verdean EscudoCZKCzech Republic KorunaDJFDjiboutian FrancDKKDanish KroneDOPDominican PesoDZDAlgerian DinarEGPEgyptian PoundERNEritrean NakfaETBEthiopian BirrEUREuroFJDFijian DollarFKPFalkland Islands PoundGBPBritish Pound SterlingGELGeorgian LariGGPGuernsey PoundGHSGhanaian CediGIPGibraltar PoundGMDGambian DalasiGNFGuinean FrancGTQGuatemalan QuetzalGYDGuyanaese DollarHKDHong Kong DollarHNLHonduran LempiraHRKCroatian KunaHTGHaitian GourdeHUFHungarian ForintIDRIndonesian RupiahILSIsraeli New SheqelIMPManx poundINRIndian RupeeIQDIraqi DinarIRRIranian RialISKIcelandic KrónaJEPJersey PoundJMDJamaican DollarJODJordanian DinarJPYJapanese YenKESKenyan ShillingKGSKyrgystani SomKHRCambodian RielKMFComorian FrancKPWNorth Korean WonKRWSouth Korean WonKWDKuwaiti DinarKYDCayman Islands DollarKZTKazakhstani TengeLAKLaotian KipLBPLebanese PoundLKRSri Lankan RupeeLRDLiberian DollarLSLLesotho LotiLTLLithuanian LitasLVLLatvian LatsLYDLibyan DinarMADMoroccan DirhamMDLMoldovan LeuMGAMalagasy AriaryMKDMacedonian DenarMMKMyanma KyatMNTMongolian TugrikMOPMacanese PatacaMROMauritanian OuguiyaMURMauritian RupeeMVRMaldivian RufiyaaMWKMalawian KwachaMXNMexican PesoMYRMalaysian RinggitMZNMozambican MeticalNADNamibian DollarNGNNigerian NairaNIONicaraguan CórdobaNOKNorwegian KroneNPRNepalese RupeeNZDNew Zealand DollarOMROmani RialPABPanamanian BalboaPENPeruvian Nuevo SolPGKPapua New Guinean KinaPHPPhilippine PesoPKRPakistani RupeePLNPolish ZlotyPYGParaguayan GuaraniQARQatari RialRONRomanian LeuRSDSerbian DinarRUBRussian RubleRWFRwandan FrancSARSaudi RiyalSBDSolomon Islands DollarSCRSeychellois RupeeSDGSudanese PoundSEKSwedish KronaSGDSingapore DollarSHPSaint Helena PoundSLLSierra Leonean LeoneSOSSomali ShillingSRDSurinamese DollarSTDSão Tomé and Príncipe DobraSVCSalvadoran ColónSYPSyrian PoundSZLSwazi LilangeniTHBThai BahtTJSTajikistani SomoniTMTTurkmenistani ManatTNDTunisian DinarTOPTongan PaʻangaTRYTurkish LiraTTDTrinidad and Tobago DollarTWDNew Taiwan DollarTZSTanzanian ShillingUAHUkrainian HryvniaUGXUgandan ShillingUSDUnited States DollarUYUUruguayan PesoUZSUzbekistan SomVEFVenezuelan Bolívar FuerteVNDVietnamese DongVUVVanuatu VatuWSTSamoan TalaXAFCFA Franc BEACXAGSilver (troy ounce)XAUGold (troy ounce)XCDEast Caribbean DollarXDRSpecial Drawing RightsXOFCFA Franc BCEAOXPFCFP FrancYERYemeni RialZARSouth African RandZMKZambian Kwacha (pre-2013)ZMWZambian KwachaZWLZimbabwean DollarTesting
-------

[](#testing)

If you are contributing new changes to the package, you can run the tests by running the following command from the packages's root folder:

```
composer test
```

Security
--------

[](#security)

If you find any security related issues, please contact me directly at  to report it.

Contribution
------------

[](#contribution)

If you wish to make any changes or improvements to the package, feel free to make a pull request.

To contribute to this library, please use the following guidelines before submitting your pull request:

- Write tests for any new functions that are added. If you are updating existing code, make sure that the existing tests pass and write more if needed.
- Follow [PSR-2](https://www.php-fig.org/psr/psr-2/) coding standards.
- Make all pull requests to the `master` branch.

Credits
-------

[](#credits)

- [Ash Allen](https://ashallendesign.co.uk)
- [Zak](https://github.com/thugic)
- [Jess Pickup](https://jesspickup.co.uk) (Logo)
- [All Contributors](https://github.com/ash-jc-allen/short-url/graphs/contributors)

Changelog
---------

[](#changelog)

Check the [CHANGELOG](CHANGELOG.md) to get more information about the latest changes.

Upgrading
---------

[](#upgrading)

Check the [UPGRADE](UPGRADE.md) guide to get more information on how to update this library to newer versions.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Support Me
----------

[](#support-me)

If you've found this package useful, please consider buying a copy of [Battle Ready Laravel](https://battle-ready-laravel.com) to support me and my work.

Every sale makes a huge difference to me and allows me to spend more time working on open-source projects and tutorials.

To say a huge thanks, you can use the code **BATTLE20** to get a 20% discount on the book.

[👉 Get Your Copy!](https://battle-ready-laravel.com)

[![Battle Ready Laravel](https://camo.githubusercontent.com/20876b9d7d30882812a8e9da128da0966cc0b72473fb9ed6b2941294475bbcb0/68747470733a2f2f617368616c6c656e64657369676e2e636f2e756b2f696d616765732f637573746f6d2f73706f6e736f72732f626174746c652d72656164792d6c61726176656c2d686f72697a6f6e74616c2d62616e6e65722e706e67)](https://battle-ready-laravel.com)

###  Health Score

68

—

FairBetter than 100% of packages

Maintenance86

Actively maintained with recent releases

Popularity60

Solid adoption and visibility

Community27

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 89.1% 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 ~63 days

Recently: every ~116 days

Total

37

Last Release

66d ago

Major Versions

v2.2.0 → v3.0.02020-07-14

v3.3.0 → v4.0.02021-04-01

v4.1.0 → v5.0.02022-01-26

v5.2.0 → v6.0.02023-02-08

v6.1.0 → v7.0.02023-03-23

PHP version history (4 changes)v0.0.1PHP ^7.2

v3.3.0PHP ^7.2|^8.0

v5.0.0PHP ^8.0

v7.11.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![ash-jc-allen](https://avatars.githubusercontent.com/u/39652331?v=4)](https://github.com/ash-jc-allen "ash-jc-allen (407 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (17 commits)")[![SanderMuller](https://avatars.githubusercontent.com/u/9074391?v=4)](https://github.com/SanderMuller "SanderMuller (5 commits)")[![viicslen](https://avatars.githubusercontent.com/u/39545521?v=4)](https://github.com/viicslen "viicslen (5 commits)")[![riaanlom](https://avatars.githubusercontent.com/u/23080199?v=4)](https://github.com/riaanlom "riaanlom (3 commits)")[![ragulka](https://avatars.githubusercontent.com/u/593267?v=4)](https://github.com/ragulka "ragulka (3 commits)")[![ktovergara](https://avatars.githubusercontent.com/u/130693685?v=4)](https://github.com/ktovergara "ktovergara (3 commits)")[![jlevers](https://avatars.githubusercontent.com/u/4974856?v=4)](https://github.com/jlevers "jlevers (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![peterfox](https://avatars.githubusercontent.com/u/1716506?v=4)](https://github.com/peterfox "peterfox (2 commits)")[![yuters](https://avatars.githubusercontent.com/u/801718?v=4)](https://github.com/yuters "yuters (1 commits)")[![faissaloux](https://avatars.githubusercontent.com/u/60013703?v=4)](https://github.com/faissaloux "faissaloux (1 commits)")[![martyn-v](https://avatars.githubusercontent.com/u/81797311?v=4)](https://github.com/martyn-v "martyn-v (1 commits)")[![neochief](https://avatars.githubusercontent.com/u/121889?v=4)](https://github.com/neochief "neochief (1 commits)")[![philipsorensen](https://avatars.githubusercontent.com/u/5397535?v=4)](https://github.com/philipsorensen "philipsorensen (1 commits)")[![pointybeard](https://avatars.githubusercontent.com/u/24912?v=4)](https://github.com/pointybeard "pointybeard (1 commits)")[![thugic](https://avatars.githubusercontent.com/u/22091704?v=4)](https://github.com/thugic "thugic (1 commits)")[![A-Lawrence](https://avatars.githubusercontent.com/u/1240362?v=4)](https://github.com/A-Lawrence "A-Lawrence (1 commits)")

---

Tags

hacktoberfestlaravelexchange rateashallendesignexchangeratesapi.iolaravel-exchange-rates

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/ashallendesign-laravel-exchange-rates/health.svg)

```
[![Health](https://phpackages.com/badges/ashallendesign-laravel-exchange-rates/health.svg)](https://phpackages.com/packages/ashallendesign-laravel-exchange-rates)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[ashallendesign/favicon-fetcher

A Laravel package for fetching website's favicons.

190272.4k3](/packages/ashallendesign-favicon-fetcher)[flarum/core

Delightfully simple forum software.

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

PHPackages © 2026

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