PHP code example of sachinkiranti / nrb-forex-api

1. Go to this page and download the library: Download sachinkiranti/nrb-forex-api 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/ */

    

sachinkiranti / nrb-forex-api example snippets


'providers' => [
    // ...
    SachinKiranti\NrbForexApi\NrbForexApiServiceProvider::class,
];

'aliases' => [
    // ...
    SachinKiranti\NrbForexApi\Facades\NrbForexApi::class,
];

 NrbForexApi::to(\SachinKiranti\NrbForexApi\NrbForexISO3::US_DOLLAR)->convert(5);
 // Outputs : (Right now, US Dollar per unit === 122.24 NRS)
 611.2

 nrb_forex_convert(\SachinKiranti\NrbForexApi\NrbForexISO3::INDIAN_RUPEE, 100)
 // Outputs : (Right now, Indian ruppee per 100 unit === 160 NRS)
 160

php artisan vendor:publish --tag=nrb-forex-api