This is a library that provides a RateProvider class for the Brick\Money based on the Peso for PHP.
composer require peso/brick-rateprovider<?php
use Brick\Money\CurrencyConverter;
use Brick\Money\Money;
use Peso\Brick\PesoRateProvider;
use Peso\Services\EuropeanCentralBankService;
require __DIR__ . '/vendor/autoload.php';
$rateProvider = new PesoRateProvider(new EuropeanCentralBankService());
$converter = new CurrencyConverter($rateProvider);
$eur100 = Money::of(100.00, 'EUR');
echo $converter->convert($eur100, 'USD'), PHP_EOL; // 'USD ...'Read the full documentation here: https://phpeso.org/v1.x/integrations/brick-rateprovider.html
Please file issues on our main repo at GitHub: https://github.com/phpeso/brick-rateprovider/issues
The library is available as open source under the terms of the MIT License.