wilkques / exchange-rate
Easy Exchange Rate
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/wilkques/exchange-rate
Requires
- php: ^7.4|^8.0
- ext-curl: *
- ext-json: *
- wilkques/http-client: ^1.0.0
README
composer require wilkques/exchange-rate
API
| API | Url | Document |
|---|---|---|
| exchangeratesapi | https://api.exchangeratesapi.io | https://exchangeratesapi.io/documentation/ |
How to use
-
Get ExchangeRatesApi
use Wilkques\ExchangeRates\ExchangeRate; use Wilkques\ExchangeRates\Enum\FactoriesEnum; $exchangeRate = (new ExchangeRate)->exchangeRate( FactoriesEnum::Exchangeratesapi )->token('<access token>'); // or $exchangeRate = ExchangeRate::make( FactoriesEnum::Exchangeratesapi )->token('<access token>')
-
Example
$currencies = $exchangeRate->symbols(); $currencies->throw(); // throw exception // or $currencies->throw(function ($response, $exception) { // code }); $currencies = $currencies->json(); // to array
-
All Methods
- ExchangeRatesApi
Methods Description tokenset access token urlset api url apiVersionset api version currenciesset currencies callbackset callback baseset base fromset from toset to amountset amount startDateset startDate endDateset endDate latestcall api with latest symbolscall api with symbols historicalcall api with historical convertcall api with convert timeseriescall api with timeseries fluctuationcall api with fluctuation throwthrow Exception
- ExchangeRatesApi