PHP code example of quicktech-as / exchange-rate

1. Go to this page and download the library: Download quicktech-as/exchange-rate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

quicktech-as / exchange-rate example snippets


Quicktech\ExchangeRate\ExchangeRateServiceProvider::class,

'ExchangeRate' => Quicktech\ExchangeRate\Facade\ExchangeRate::class,

EXCHANGERATE_DEFAULT_CURRENCY = 'your default currency'
EXCHANGERATE_API_KEY = 'your api key'
EXCHANGERATE_API_URI = 'https://v3.exchangerate-api.com'

$rates = ExchangeRate::rates();

[
    "AUD" => 1.32230,
    "BGN" => 1.8096,
    "BRL" => 3.11,
    "..." => 1.31135,
    "..." => 7.473, etc. etc.
]

$value = ExchangeRate::convert(10.00, 'USD', 'BRL');
// 31.11
json
"quicktech-as/exchange-rate": "^1.0"
shell
php artisan vendor:publish