Skip to content

This package provides seamless integration with the web service of the National Bank of the Republic of Macedonia (NBRM). It allows Laravel applications to fetch foreign exchange rates and currency data directly from NBRM’s official API

Notifications You must be signed in to change notification settings

KalimeroMK/nbrm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel NBRM Package

Description

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.

Installation

To install the package, use composer:

composer require kalimeromk/nbrm

Configuration

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

Usage

Import the facade in your Laravel project:

use Kalimeromk\Nbrm\Facades\NBRMExchange;

Get Exchange Rate

$response = NBRMExchange::getExchangeRate('01.02.2024', '08.02.2024');
print_r($response);

Get Exchange Rate (Detailed Format)

$response = NBRMExchange::getExchangeRateD('01-Feb-2024', '08-Feb-2024');
print_r($response);

Get Exchange Rates (All Currencies)

$response = NBRMExchange::getExchangeRates('01.02.2024', '08.02.2024');
print_r($response);

Get Exchange Rates (Detailed Format)

$response = NBRMExchange::getExchangeRatesD('01-Feb-2024', '08-Feb-2024');
print_r($response);

Testing

Run the PHPUnit tests to verify that the package works correctly:

vendor/bin/phpunit

License

This package is open-sourced software licensed under the MIT License.

About

This package provides seamless integration with the web service of the National Bank of the Republic of Macedonia (NBRM). It allows Laravel applications to fetch foreign exchange rates and currency data directly from NBRM’s official API

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages