Skip to content

projecthanif/exchangerate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

A simple Laravel package used for interacting with ExchangeRate Api.

Installation

You can install the package via Composer:

composer require projecthanif/exchangerate

Api

This Exchange rate package only supports ExchangeRate Api

Configuration

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}

Usage

Method

To get Supported Currencies

use Projecthanif/ExchangeRate/ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$supportedCurrencies = $exchangeRates->getSupportedCodes();

Exchange Rates

To get Exchange Rate of a currency relative to another

It takes a string which will be a valid currency code

use Projecthanif/ExchangeRate/ExchangeRate;

$exchangeRates = app(ExchangeRate::class);

$rates = $exchangeRates->standardResponse("NGN")->getConversionRates();
To get a particular one out of the above one

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");

Releases

No releases published

Packages

No packages published

Languages