Laravel Exchange Rates API Package

Laravel Exchange Rates API Package

Laravel Exchange Rates is a package by Ash Allen for interacting with the exchangeratesapi.io API. The API provides the latest exchange rate data as well as historical rates.

Here’s a few usage examples you can expect from this package:

First, you can get available currencies:

$exchangeRates = new ExchangeRate();
$exchangeRates->currencies();

Get the exchange rate between two countries:

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

You can get an exchange rate between dates:

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

The following will convert 1GBP (£1 = 100 pence) to the euro:

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

You can learn more about this package, get full installation instructions, and view the source code on GitHub at ash-jc-allen/laravel-exchange-rates.

Filed in: News / packages

Newsletter

Join 31,000+ others and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Software Developer
Remote (US & Canada)
Alley
😎 Laravel Developer
Remote
Jogg, Inc
Junior, Mid, and Senior Software Engineers. Laravel / Vue. Saint Petersburg, FL
Saint Petersburg, FL and Remote
ShineOn
Senior PHP Developer (Laravel)
Remote
The Interaction Design Foundation
Fullstack Laravel Engineer (Munich/Remote) 💻
Munich, Germany or Remote
AirLST GmbH