1. Go to this page and download the library: Download elegantly/laravel-forex 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/ */
use Elegantly\Forex\Integrations\ExchangeRateApi\ExchangeRateApiConnector;
'client' => ExchangeRateApiConnector::class,
use Carbon\CarbonInterface;
use Elegantly\Forex\ForexClient;
class MyCustomForexClient implements ForexClient
{
public function latest(string $currency): array
{
// Return an associative array of currency code => rate
}
public function rates(CarbonInterface $date, string $currency): array
{
// Return historical rates for the given date
}
}