This package allows you Exchange Rates with TbcBank API
composer require ardigital/tbc-exchange-rates
Open config/app.php
and add TbcExchangeRatesServiceProvider
to the providers
array.
'providers' => [
ArDigital\TbcExchangeRates\TbcExchangeRatesServiceProvider::class,
],
Then run:
php artisan vendor:publish --provider="ArDigital\TbcExchangeRates\TbcExchangeRatesServiceProvider"
Place your api key config/tbcexchange.php
file Or .env :
TBC_EXCHANGE_RATES_KEY="Your Api Key"
TBC_GUZZLE_VERIFY=false
In TbcExchangeRates
class, add ResultLis()
method and return currency
use ArDigital\TbcExchangeRates\TbcExchangeRates;
public function getCurrency(){
TbcExchangeRates::get(); // Return All currency
TbcExchangeRates::get('USD'); // Return Usd currency USD buy and sell
}
OR:
public function Convert(){
TbcExchangeRates::Convert(100, 'USD', 'GEL');
}