A simple Laravel package used for interacting with ExchangeRate Api.
You can install the package via Composer:
composer require projecthanif/exchangerate
This Exchange rate package only supports ExchangeRate Api
You should publish the package's config file using the following command:
php artisan vendor:publish --provider="Projecthanif\ExchangeRate\ExchangeRateServiceProvider"
You would need to get your api key from ExchangeRate
ExchangeRate_API_KEY={Your-API-Key-Here}
use Projecthanif/ExchangeRate/ExchangeRate;
$exchangeRates = app(ExchangeRate::class);
$supportedCurrencies = $exchangeRates->getSupportedCodes();
It takes a string which will be a valid currency code
use Projecthanif/ExchangeRate/ExchangeRate;
$exchangeRates = app(ExchangeRate::class);
$rates = $exchangeRates->standardResponse("NGN")->getConversionRates();
It takes a string which will be a valid currency code
use Projecthanif/ExchangeRate/ExchangeRate;
$exchangeRates = app(ExchangeRate::class);
$supportedCurrencies = $exchangeRates->standardResponse("NGN")->getConversionRates("USD");