neputertech/nrb-forex-api is a Laravel package for fetch nepal rastra bank forex api.
It currently has 1 GitHub stars and 44 downloads on Packagist.
Install it with composer require neputertech/nrb-forex-api.
Discover more Laravel packages by neputertech
or browse all Laravel packages to compare alternatives.
Last updated
The neputertech/nrb-forex-api package provides easy access to the forex rate fixed by Nepal Rastra Bank for different countries to Nepali Rupees(NPR).
Installation is straightforward, setup is similar to every other Laravel Packages.
Begin by pulling in the package through Composer:
composer require neputertech/nrb-forex-api
Note: This package supports the new auto discovery features of Laravel >=5.5, so if you are working on a Laravel >=5.5 project, then your installation is complete, you can skip to step 3.
Add manually the service provider in your config/app.php file :
'providers' => [
// ...
NeputerTech\NrbForexApi\NrbForexApiServiceProvider::class,
];
Add manually the facade in your config/app.php file :
'aliases' => [
// ...
NeputerTech\NrbForexApi\Facades\NrbForexApi::class,
];
To generate a config file type this command into your terminal:
php artisan vendor:publish --tag=nrb-forex-api
Using the NrbForexApi package, it's quite easy to get the current rate's.
We have the NeputerTech\NrbForexApi\NrbForexISO3 for ISO3 list of constants to be used.
NrbForexApi::to(\NeputerTech\NrbForexApi\NrbForexISO3::US_DOLLAR)->convert(5);
// Outputs : (Right now, US Dollar per unit === 122.24 NRS)
611.2
nrb_forex_convert(\NeputerTech\NrbForexApi\NrbForexISO3::INDIAN_RUPEE, 100)
// Outputs : (Right now, Indian ruppee per 100 unit === 160 NRS)
160
The MIT License (MIT). Please see License File for more information.