dev-master
9999999-dev https://github.com/marleysidapple/currencycurrency api for laravel
MIT
The Requires
- php >=5.4.0
- guzzlehttp/guzzle ~4.0
The Development Requires
by Siddhartha
currency exchange-rate currency-exchange-api currency-exchange
Wallogit.com
2017 © Pedro Peláez
currency api for laravel
Get latest currency exchange rates for different dates., (*1)
this will require guzzle. so first make sure you have installed guzzle., (*2)
"guzzlehttp/guzzle": "~4.0"
To install, edit your composer.json and add the line mentioned below., (*3)
"marleysidapple/currency": "dev-master"
Then run composer update, (*4)
After installation, go to config/app.php. Add in provider array, (*5)
Marleysid\Currency\CurrencyServiceProvider::class,
Add alias as well in alias array, (*6)
'Currency'=> Marleysid\Currency\Facade\CurrencyFacade::class,
For publishing configuration. Run following command, (*7)
php artisan vendor:publish
Once publish is completed, open config/currency.php. It contains two element. One is url which is an api endpoint and another one is baseCurrency. You can change baseCurrency and set standard currency of your own, however url value is not meant to be changed., (*8)
add use Currency; in the top of the controller., (*9)
$exchangeRate = Currency::exchangeRate('baseCurrency', 'date', 'conversionCurrency');
if baseCurrency is set to GBP, all the conversion rates will be show in respect to GBP as a base. Passing date will give the exchange rate for that particular date. And passing conversionCurrency will give the exchange Rate for that particular conversionCurrency in respect to the specified baseCurrency., (*10)
$exRate = Currency::exchangeRate('USD');
returns all available exrates with respect to the USD as a base currency for present date., (*11)
$exRate = Currency::exchangeRate('USD', '2015-10-23');
returns exrates for the specified date, (*12)
$exRate = Currency::exchangeRate('USD', '2015-10-23', 'AUD');
returns exrate of 1 USD to 1 AUD on specified date, (*13)
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us., (*14)
This project is licensed under the MIT License - see the LICENSE.md file for details, (*15)
currency api for laravel
MIT
currency exchange-rate currency-exchange-api currency-exchange