Skip to content

norbybaru/exchange-rate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Exchange Rate

Laravel Exchange Rate Package Allows to convert money from one currency to another using latest exchange rate on market

Supported Providers

Installation

composer require norbybaru/exchange-rate

Publish Config config/exchange-rate.php

php artisan vendor:publish --tag="exchange-rate-config"

Publish Migrations

php artisan vendor:publish --tag="exchange-rate-migration"

Run Migration

php artisan migrate

Usage

Update exchange rate to get latest rate on the market. Run below command to get latest exchange rate

php artisan exchange-rate:update

It is recommended to run this command as a cron job to update exchange rates daily. For more information, see Laravel Scheduler

  • Get Rate
<?php
use NorbyBaru\ExchangeRate\Facades\Exchange;

$rate = Exchange::rate("USD");
  • Convert Currency
<?php

use NorbyBaru\ExchangeRate\Facades\Exchange;

$money = Exchange::convert(5000, 'USD', 'ZAR');

About

Laravel exchange rate wrapper for different currencies using multipe providers

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages