PHPackages                             greksazoo/mnb-exchange-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. greksazoo/mnb-exchange-laravel

ActiveLibrary[API Development](/categories/api)

greksazoo/mnb-exchange-laravel
==============================

This is a MNB(Magyar Nemzeti Bank) exchange rate query package for Laravel.

1.1.8(3y ago)0104MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Oct 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/greksazoo/mnb-exchange-laravel)[ Packagist](https://packagist.org/packages/greksazoo/mnb-exchange-laravel)[ Docs](https://github.com/greksazoo/mnb-exchange-laravel)[ RSS](/packages/greksazoo-mnb-exchange-laravel/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (12)Used By (0)

MNB Exchange Rate package for Laravel
=====================================

[](#mnb-exchange-rate-package-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9f3b0f64a895a1b16fefaa83d120aff57634a65612e8922211e43b041463f7c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6772656b73617a6f6f2f6d6e622d65786368616e67652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/greksazoo/mnb-exchange-laravel)[![PHPStan](https://github.com/greksazoo/mnb-exchange-laravel/actions/workflows/phpstan.yml/badge.svg)](https://github.com/greksazoo/mnb-exchange-laravel/actions/workflows/phpstan.yml)[![Total Downloads](https://camo.githubusercontent.com/e968d0426462a7323237451c5ffc18be5d4dd8afb5f7ad986b892f24b29b7ec1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6772656b73617a6f6f2f6d6e622d65786368616e67652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/greksazoo/mnb-exchange-laravel)

This is a MNB Exchange Rate query package for Laravel v8 or above.

Requirements
------------

[](#requirements)

Package requires PHP v7.4 or above, with Soap and SimpleXml. Not tested with previous versions of Laravel.

Know-how
--------

[](#know-how)

This package is mainly based on top of [MNB package](https://github.com/SzuniSOFT/php-mnb) and [MNB Laravel package](https://github.com/SzuniSOFT/laravel-mnb).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require greksazoo/mnb-exchange-laravel
```

Configuration
-------------

[](#configuration)

### Export

[](#export)

```
php artisan vendor:publish --provider="Greksazoo\MnbExchangeLaravel\MnbExchangeLaravelServiceProvider" --tag="config"
```

### config/mnb-exchange.php

[](#configmnb-exchangephp)

```
    /*
     * 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),
    ]
```

Usage
-----

[](#usage)

### Access via facade

[](#access-via-facade)

```
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'
```

### Resolve by application container

[](#resolve-by-application-container)

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

### Access refresh date by reference

[](#access-refresh-date-by-reference)

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();
```

### Available methods

[](#available-methods)

#### Won't use cache

[](#wont-use-cache)

These methods won't use and update cache.

- currentExchangeRate($code, &amp;$date = null): Currency
- currentExchangeRates(&amp;$date = null): array of Currency

#### Will use cache

[](#will-use-cache)

These methods will use cache.

- exchangeRate($code, &amp;$date = null): single Currency
- exchangeRates(&amp;$date = null): array of currencies
- currencies(): array of strings (each is currency code)
- hasCurrency($code): bool

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Zoltan Greksa](https://github.com/greksazoo)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~48 days

Recently: every ~29 days

Total

11

Last Release

1234d ago

PHP version history (3 changes)1.0PHP ^7.4|^8.0

1.1.1PHP ^7.4|^8.0|^8.1

1.1.8PHP ^7.4|^8.0|^8.1|^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17304994?v=4)[grezoo](/maintainers/greksazoo)[@greksazoo](https://github.com/greksazoo)

---

Top Contributors

[![greksazoo](https://avatars.githubusercontent.com/u/17304994?v=4)](https://github.com/greksazoo "greksazoo (16 commits)")

---

Tags

laravelcurrencypackageBankRateexchangemagyarmnbnemzetimnb-exchange-laravel

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/greksazoo-mnb-exchange-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/greksazoo-mnb-exchange-laravel/health.svg)](https://phpackages.com/packages/greksazoo-mnb-exchange-laravel)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.0M69](/packages/spatie-laravel-responsecache)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
