-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,44 @@ | ||
# Laravel Exchange Rate | ||
Allows to convert money from one currency to another using latest exchange rate on market | ||
|
||
## Installation | ||
|
||
```php | ||
$ composer install norbybaru/exchange-rate | ||
``` | ||
Publish Config `config/exchange.php` | ||
```php | ||
$ php artisan vendor:publish --provider="NorbyBaru\ExchangeRate\ExchangeRateServiceProvider" | ||
``` | ||
|
||
Run Migration | ||
```php | ||
$ php artisan migrate | ||
``` | ||
|
||
## Usage | ||
Update exchange rate to get latest rate on the market. | ||
Run below command to get latest exchange rate | ||
|
||
```php | ||
$ php artisan rate:update | ||
``` | ||
|
||
* Get Rate | ||
```php | ||
<?php | ||
use NorbyBaru\ExchangeRate\Facades\Exchange; | ||
|
||
$rate = Exchange::rate("USD"); | ||
|
||
``` | ||
|
||
* Convert Currency | ||
```php | ||
<?php | ||
|
||
use NorbyBaru\ExchangeRate\Facades\Exchange; | ||
|
||
$money = Exchange::convert(5000, 'USD', 'ZAR'); | ||
|
||
``` |