finller / laravel-forex
Forex for Laravel
Fund package maintenance!
Finller
Installs: 1 650
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0
- saloonphp/cache-plugin: ^3.0
- saloonphp/laravel-plugin: ^3.0
- saloonphp/rate-limit-plugin: ^2.0
- saloonphp/saloon: ^3.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8|^8.1
- orchestra/testbench: ^8.8|^9.0
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.5
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
Easily retreive latest exchange rates value in your app.
By default, this package use the free endpoint provided by exchangerate-api.com but you can use it with any forex provider.
Installation
You can install the package via composer:
composer require finller/laravel-forex
You can publish the config file with:
php artisan vendor:publish --tag="laravel-forex-config"
This is the contents of the published config file:
use Finller\Forex\Integrations\ExchangeRateApi\ExchangeRateApiConnector; return [ 'cache' => [ 'enabled' => true, 'driver' => env('FOREX_CACHE_DRIVER', env('CACHE_DRIVER', 'file')), 'expiry_seconds' => 86_400, ], 'rate_limit' => [ 'enabled' => false, 'driver' => env('FOREX_RATE_LIMIT_DRIVER', env('CACHE_DRIVER', 'file')), 'every_seconds' => 3_600, ], 'client' => ExchangeRateApiConnector::class, ];
Usage
$rates = \Finller\Forex\Facades\Forex::get('USD'); $USD_to_EUR_rate = $rates['EUR'];
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.