Download the PHP package alexbabintsev/laravel-nbu without Composer

On this page you can find all versions of the php package alexbabintsev/laravel-nbu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-nbu

Stand With Ukraine Made in Ukraine Stand With Ukraine

laravel-nbu

Tests Latest Version Downloads

The official exchange rates of the National Bank of Ukraine, for Laravel: any date, cached until midnight, and a fallback when the bank is unreachable.

Українською ↓

The NBU sets one rate per currency per banking day and publishes it on an open endpoint that needs no key. That much is simple; what a project actually has to handle is everything around it. A rate must not be fetched twice for the same day, a rate already published for a past date never changes and should never expire, and a page showing a price should not fail because bank.gov.ua is down.

This wraps those three rules and nothing else. No runtime dependency beyond Laravel itself.

Installation

The package works out of the box; publish the config only if you want to change the timeout or the cache store:

Usage

A rate on a given date

Every currency

Conversion

Caching

The bank sets one rate per banking day, so the package does not ask twice:

When the bank is unreachable

A page showing a price should not fail because bank.gov.ua is down, so the last known rates are served instead of throwing. Ask when it matters:

NbuException is thrown only when the bank is unreachable and nothing is cached to fall back on.

Configuration

Testing

The package uses Laravel's own HTTP client, so it fakes like anything else:

Requirements

PHP 8.2+, Laravel 11, 12 or 13.

License

MIT. See LICENSE.md.


laravel-nbu (українською)

In English ↑

Офіційний курс валют Національного банку України для Laravel: курс на будь-яку дату, кеш до півночі та резервне значення, коли банк недоступний.

НБУ встановлює один курс на валюту за банківський день і публікує його на відкритому ендпоінті без ключа. Це проста частина; складнощі починаються навколо. Курс не варто запитувати двічі за той самий день, курс за минулу дату вже не зміниться і не має протухати, а сторінка з ціною не повинна падати через недоступний bank.gov.ua.

Пакет закриває саме ці три правила і більше нічого. Жодних залежностей, крім самого Laravel.

Встановлення

Пакет працює одразу; конфіг публікуйте, лише якщо треба змінити таймаут або сховище кешу:

Використання

Курс на дату

Усі валюти

Конвертація

Кешування

Банк встановлює один курс на банківський день, тому пакет не питає двічі:

Коли банк недоступний

Сторінка з ціною не повинна падати через недоступний bank.gov.ua, тому пакет віддає останній відомий курс замість винятку. Запитайте, якщо це важливо:

NbuException кидається лише тоді, коли банк недоступний і в кеші нічого немає.

Налаштування

Тестування

Пакет ходить у мережу звичайним HTTP-клієнтом Laravel, тому підміняється штатним фейком:

Вимоги

PHP 8.2+, Laravel 11, 12 або 13.

Ліцензія

MIT. Деталі у LICENSE.md.


All versions of laravel-nbu with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0||^12.0||^13.0
illuminate/http Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alexbabintsev/laravel-nbu contains the following files

Loading the files please wait ...