This is a MNB(Magyar Nemzeti Bank) exchange rate query package for Laravel.
greksazoo/mnb-exchange-laravel is a Laravel package for this is a mnb(magyar nemzeti bank) exchange rate query package for laravel..
It currently has 0 GitHub stars and 104 downloads on Packagist (latest version 1.1.8).
Install it with composer require greksazoo/mnb-exchange-laravel.
Discover more Laravel packages by greksazoo
or browse all Laravel packages to compare alternatives.
Last updated
This is a MNB Exchange Rate query package for Laravel v8 or above.
Package requires PHP v7.4 or above, with Soap and SimpleXml. Not tested with previous versions of Laravel.
This package is mainly based on top of MNB package and MNB Laravel package.
You can install the package via composer:
composer require greksazoo/mnb-exchange-laravel
php artisan vendor:publish --provider="Greksazoo\MnbExchangeLaravel\MnbExchangeLaravelServiceProvider" --tag="config"
/*
* 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');
You can check the feed date by passing a $date variable to some methods. These methods will make variable to be a Carbon instance.
Mnb::exchangeRates($date);
$date->isToday();
These methods won't use and update cache.
These methods will use cache.
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.