kalimeromk/nbrm
最新稳定版本:1.3
Composer 安装命令:
composer require kalimeromk/nbrm
包简介
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.
关键字:
README 文档
README
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.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-08