Installation
Requirements
Section titled “Requirements”- PHP ^8.1
- Laravel 9 – 13 (
illuminate/support,illuminate/http,illuminate/cache) - A cache store — rates are always read through Laravel
Cache
Install
Section titled “Install”composer require fomvasss/laravel-currencyThe service provider Fomvasss\Currency\ServiceProvider and the Currency facade alias are registered by package auto-discovery.
Publish the config
Section titled “Publish the config”php artisan vendor:publish --tag=currency-configThis copies config/currency.php into your app. Without publishing, the package’s own defaults are merged in: base currency UAH, provider monobank, four active currencies (EUR, PLN, UAH, USD). See Configuration.
The package has no migrations, no routes and no views.
Check it works
Section titled “Check it works”php artisan currency:ratesphp artisan currency:convert 100 usd uahcurrency:rates prints the provider, the base currency and a table of buy/sell/average rates. If it prints No rates available., the provider’s API could not be reached — see Caching & failures.
Pick a provider
Section titled “Pick a provider”The default monobank provider needs no API key and covers 15 currencies against UAH. For a non-Ukrainian setup, or more currencies, choose another one in .env:
CURRENCY_DEFAULT_PROVIDER=jsdelivrTo express rates in a currency other than UAH, change default in config/currency.php — see Rate providers and Base currency.