PHP code example of csaba215 / laravel-mnb

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

    

csaba215 / laravel-mnb example snippets


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

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

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

        /*
         * Desired cache key prefix.
         * */
        'key' => env('MNB_CACHE_KEY', 'mnb'),
    ],
];

use Csaba215\Mnb\Laravel\Facade\Mnb

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

$currency = app(\Csaba215\Mnb\Laravel\Client::class)->exchangeRate('EUR');

Mnb::exchangeRate("EUR", "2025-04-22");
bash
php artisan vendor:publish --provider="Csaba215\Mnb\Laravel\MnbServiceProvider" --tag="config"