1. Go to this page and download the library: Download alexbabintsev/laravel-nbu 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/ */
alexbabintsev / laravel-nbu example snippets
use AlexBabintsev\Nbu\Facades\Nbu;
Nbu::rate('USD')->rate; // 44.7006
Nbu::rate('USD')->name; // "Долар США"
Nbu::rate('USD')->date; // CarbonImmutable
Nbu::rate('XYZ'); // null - the NBU publishes no such currency
Nbu::rateOrFail('XYZ'); // NbuException
Nbu::rate('USD', '2026-03-01'); // 43.2081
Nbu::rate('EUR', now()->subMonth()); // a DateTime works too