src/Exchangers/OpenExchangeRatesExchanger.php
public function setRates()
    {
        // Avoid instance issues
        $self = $this;

        // Cache the currencies
        return $this->rates = $this->cache->remember('currencies', $this->getExpires(), function () use ($self) {
            if (! $appId = $self->getAppId()) {
                throw new Exception('OpenExchangeRates.org requires an app key.');
            }

            $client = new Client([ 'base_url' => $self->getUrl() ]);

            $data = $client->get("latest.json?app_id={$appId}")->json();

            return $data['rates'];
        });
    }
public function setRates()
    {
        // Avoid instance issues
        $self = $this;

        // Cache the currencies
        return $this->rates = $this->cache->remember('currencies', $this->getExpires(), function () use ($self) {
            if (! $appId = $self->getAppId()) {
                throw new Exception('OpenExchangeRates.org requires an app key.');
            }

            $client = new Client([ 'base_url' => $self->getUrl() ]);

            $data = $client->get("latest.json?app_id={$appId}")->json();

            return $data['rates'];
        });
    }
public function setRates ( ) { // Avoid instance issues $ self = $ this ; // Cache the currencies return $ this -> rates = $ this -> cache -> remember ( 'currencies' , $ this -> getExpires ( ) , function ( ) use ( $ self ) { if ( ! $ appId = $ self -> getAppId ( ) ) { throw new Exception ( 'OpenExchangeRates.org requires an app key.' ) ; } $ client = new Client ( [ 'base_url' => $ self -> getUrl ( ) ] ) ; $ data = $ client -> get ( "latest.json?app_id={$appId}" ) -> json ( ) ; return $ data [ 'rates' ] ; } ) ; }
Downloads the latest exchange rates file from openexchangerates.org

@return object
Downloads the latest exchange rates file from openexchangerates . org