My Blog Posts

Laravel Exchange Rates API Package

Laravel Exchange Rates API Package


First, you can get available currencies:

$exchangeRates = new ExchangeRate();
$exchangeRates-currencies();
Get the exchange rate between the two countries:

$exchangeRates = new ExchangeRate();
$exchangeRates->exchangeRate('TRY', 'EUR');
You can get an exchange rate between dates:

$exchangeRates = new ExchangeRate();
$exchangeRates->exchangeRateBetweenDateRange(
    'TRY',
    'EUR',
    Carbon::now()->subWeek(),
    Carbon::now()
);
The following will convert 100 TRY to Euros:

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

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



Share this article


Comments (0)

Comment