This is a library that provides an Exchange class for the Money for PHP based on the Peso for PHP.
composer require peso/moneyphp-exchange
<?php
use Money\Converter;
use Money\Currencies\ISOCurrencies;
use Money\Currency;
use Money\Money;
use Peso\Money\PesoExchange;
use Peso\Services\EuropeanCentralBankService;
require __DIR__ . '/vendor/autoload.php';
$exchange = new PesoExchange(new EuropeanCentralBankService());
$converter = new Converter(new ISOCurrencies(), $exchange);
$eur100 = Money::EUR(10000);
var_dump($converter->convert($eur100, new Currency('USD'))); // Money::USD(...)
Read the full documentation here: https://phpeso.org/v1.x/integrations/moneyphp-exchange.html
Please file issues on our main repo at GitHub: https://github.com/phpeso/moneyphp-exchange/issues
The library is available as open source under the terms of the MIT License.