Looking to hire Laravel developers? Try LaraJobs

laravel-currency maintained by fomvasss

Description
Laravel package for working with multiple currencies, providing currency conversion, exchange rate management, and formatted output
Author
Last update
2026/10/07 18:52 (dev-master)
License
Links
Downloads
389

Comments
comments powered by Disqus

Laravel Currency

License Latest Stable Version Total Downloads

Currency conversion, exchange rates and money formatting for Laravel. Rates come from pluggable providers — Monobank, PrivatBank, NBU, jsDelivr currency-api, ExchangeRatesAPI, CurrencyAPI, Fixer, or your own — and are cached with a fallback for when the API is down.

Українською

  • Conversion with buy / sell / average rates
  • Seven built-in providers, switchable at runtime, plus custom ones via a small contract
  • Historical rates — convert at the rate of a past date
  • Base currency override with automatic rate recalculation
  • Caching with a long-term fallback cache and a CurrencyRateFetchFailed event
  • Formatting with symbol, precision and separators per currency
  • Helpers, Blade directives, currency:rates and currency:convert commands

Requirements

  • PHP ^8.1
  • Laravel 9 – 13

Installation

composer require fomvasss/laravel-currency

php artisan vendor:publish --tag=currency-config
CURRENCY_DEFAULT_PROVIDER=monobank

Quick start

use Fomvasss\Currency\Facades\Currency;

Currency::convert(100, 'USD', 'UAH');          // average rate
Currency::convert(100, 'USD', 'UAH', 'sell');
Currency::getRate('EUR');                      // UAH per 1 EUR
Currency::format(1234.5, 'USD');               // "$ 1,234.50"

Currency::useProvider('nbu')->convertAt(100, 'USD', 'UAH', now()->subYear());
php artisan currency:rates --provider=nbu
php artisan currency:convert 100 usd eur --format

Documentation

Online: https://fomvasss.github.io/laravel-currency/ — the same pages as in docs/.

License

MIT — see LICENSE.

Support

If this package is useful to you, consider supporting its development:

Monobank Ko-Fi USDT TRC20

USDT TRC20 address: THLgp6DxiAtbNHvgnKV56vk1L38UuUagKf