The kalimeromk/nbrm
package provides a Laravel service for retrieving exchange rates from the National Bank of the Republic of Macedonia (NBRM). The package allows users to fetch daily exchange rates and exchange rates for government institutions.
To install the package, use composer:
composer require kalimeromk/nbrm
Publish the package configuration:
php artisan vendor:publish --tag=config --provider="Kalimeromk\Nbrm\NBRMExchangeServiceProvider"
Then, update your .env
file with the API base URL:
NBRM_BASE_URL=https://www.nbrm.mk/KLServiceNOV/
NBRM_FORMAT=json
Import the facade in your Laravel project:
use Kalimeromk\Nbrm\Facades\NBRMExchange;
$response = NBRMExchange::getExchangeRate('01.02.2024', '08.02.2024');
print_r($response);
$response = NBRMExchange::getExchangeRateD('01-Feb-2024', '08-Feb-2024');
print_r($response);
$response = NBRMExchange::getExchangeRates('01.02.2024', '08.02.2024');
print_r($response);
$response = NBRMExchange::getExchangeRatesD('01-Feb-2024', '08-Feb-2024');
print_r($response);
Run the PHPUnit tests to verify that the package works correctly:
vendor/bin/phpunit
This package is open-sourced software licensed under the MIT License.