PHP code example of greksazoo / mnb-exchange-laravel

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

    

greksazoo / mnb-exchange-laravel example snippets


    /*
     * Wsdl file location.
     * */
    'wsdl' => env('MNB_SOAP_WSDL', 'http://www.mnb.hu/arfolyamok.asmx?wsdl'),

    'cache' => [

        /*
         * Desired cache driver for service.
         * */
        'store' => env('MNB_CACHE_DRIVER', 'file'),

        /*
         * Minutes the cached currencies will be held for.
         * Default: 24hrs (1440)
         * */
        'timeout' => env('MNB_CACHE_MINUTES', 1440),
    ]

use Greksazoo\MnbExchangeLaravel\Facade\Mnb

$currency = Mnb::currentExchangeRate('EUR');

echo $currency->code; // 'EUR'
echo $currency->getCode(); // 'EUR'
echo $currency->unit; // '1'
echo $currency->getUnit(); // '1'
echo $currency->amount; // '350'
echo $currency->getAmount(); // '350'


$currency = app(\Greksazoo\MnbExchangeLaravel\MnbExchangeLaravel::class)->currentExchangeRate('EUR');

Mnb::exchangeRates($date);
$date->isToday();
bash
php artisan vendor:publish --provider="Greksazoo\MnbExchangeLaravel\MnbExchangeLaravelServiceProvider" --tag="config"