PHP code example of worksome / exchange

1. Go to this page and download the library: Download worksome/exchange 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/ */

    

worksome / exchange example snippets


use Worksome\Exchange\Facades\Exchange;

$exchangeRates = Exchange::rates('USD', ['GBP', 'EUR']);

$rates = $exchangeRates->getRates(); // ['GBP' => 1.0, 'EUR' => 1.0]

it('retrieves exchange rates', function () {
    Exchange::fake(['GBP' => 1.25, 'USD' => 1.105]);
    
    $this->get(route('my-app-route'))
        ->assertOk();
        
    Exchange::assertRetrievedRates();
});
bash
php artisan exchange:install
bash
php artisan exchange:rates USD GBP EUR