norbybaru / exchange-rate
Laravel Currency Exchange rate
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/norbybaru/exchange-rate
Requires
- php: >=7.1.3
- ext-json: *
- guzzlehttp/guzzle: ^6.3
- illuminate/support: ^5.6 || ^5.7 || ^5.8
Requires (Dev)
- phpunit/phpunit: ^6.0 || ^7.0
This package is auto-updated.
Last update: 2025-11-13 06:53:51 UTC
README
Laravel Exchange Rate Package Allows to convert money from one currency to another using latest exchange rate on market
Supported Providers
- Exchangerates
- European Central Bank
- ExchangeRate-API
- OpenExchangeRates
- CurrencyLayer
- CurrencyConverterAPI
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');