https://github.com/byte5digital/currency-converter
Converts currencies with fixer.io API.
https://github.com/byte5digital/currency-converter
currency-converter fixer laravel
Last synced: 6 months ago
JSON representation
Converts currencies with fixer.io API.
- Host: GitHub
- URL: https://github.com/byte5digital/currency-converter
- Owner: byte5digital
- License: mit
- Created: 2017-12-05T13:05:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T13:26:29.000Z (over 7 years ago)
- Last Synced: 2025-03-27T04:12:38.467Z (7 months ago)
- Topics: currency-converter, fixer, laravel
- Language: PHP
- Size: 54.7 KB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# A Laravel wrapper for [fixer.io](https://fixer.io)
[](LICENSE.md)
[]()
[](https://packagist.org/packages/byte5digital/currency-converter)**Important**:
Since [fixer.io](https://fixer.io) updated their API you have to register for an account to use this package! This package does not support premium features of fixer.io yet! If you are using fixer.io premium's features, you might not even need this package anymore => take a look at the `/convert` endpoint.## Install
#### Laravel Version 5.6+
`composer require byte5digital/currency-converter`in your `.env` add your fixer.io api key
`FIXER_API_KEY=Your_api_key`*optional*
`php artisan vendor:publish --provider="Byte5\CurrencyConverter\CurrencyConverterServiceProvider"`## Usage
```
// Converting currencies
Currency::convert(100, 'EUR')->into('USD');// get currency rates
Currency::getLatestRates();// get rates for different base (default: EUR)
Currency::setBase('USD')->getLatestRates();// get specific currency rates
Currency::getLatestRates(['USD', 'GBP']);
Currency::getLatestRates('USD');// get historical currency rates
Currency::getHistoricalRates('2000-01-03');
Currency::getHistoricalRates(Carbon::yesterday());
Currency::getHistoricalRates('2000-01-03', ['USD', 'GBP']);
```## Testing
**currently not working** => did not have the time to update tests after fixer.io Api update.Run the tests with:
``` bash
vendor/bin/phpunit
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security
If you discover any security-related issues, please email kkoenig@byte5.de instead of using the issue tracker.## License
The MIT License (MIT). Please see [License File](/LICENSE.md) for more information.