Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Currency List

Currency List Laravel Package

umpirsky/currency-list

Provides up-to-date lists of world currencies for PHP apps, extracted from CLDR. Includes currency codes, names and symbols in many locales, easy to install via Composer and use for dropdowns, validation, and formatting.

Deep Wiki
Context7

umpirsky/currency-list provides a curated, localized database of world currency names and symbols for easy use in PHP/Laravel apps. It ships with multi-language lists (based on CLDR data), making it simple to display human-friendly currency labels in UIs, invoices, and reports.

Use it as a lightweight reference layer—no APIs, no network calls—just reliable currency metadata you can bundle with your project.

  • Localized currency names across many languages/locales
  • Includes symbols and standardized ISO currency codes
  • Simple, fast lookups from static data files
  • Great for forms, dropdowns, and formatting workflows
  • Easy to integrate via Composer in PHP/Laravel projects
Frequently asked questions about Currency List
How do I install umpirsky/currency-list in a Laravel project?
Run `composer require umpirsky/currency-list` in your project root. The package has no dependencies and works standalone. For Laravel, you can register it as a service provider or use it directly via `CurrencyList::get('en')` for English currency names.
Which Laravel versions does this package support?
The package is PHP-only and works with Laravel 5.5+ (or any PHP 7.2+ project). No Laravel-specific dependencies mean it’s framework-agnostic, but the examples in the docs assume Laravel 8+ conventions like service providers and facades.
Can I use this for dynamic currency dropdowns in a multi-language app?
Yes. The package provides localized currency names and symbols for over 100 languages. Fetch data like `CurrencyList::get('es')` for Spanish names, then loop through the array in Blade or a frontend framework. Cache the results for performance.
How do I update currency data if ISO 4217 changes?
The package ships with static data files. For updates, check the GitHub repo for new releases or manually replace the `data/` directory with the latest CLDR-based files. Automate this by writing a script to fetch ISO updates and regenerate the package’s data files.
Is there a way to store currency data in my database instead of using the static files?
Yes. Export the data to CSV/JSON via `CurrencyList::all()` and seed it into a `currencies` table. Use Laravel migrations to define columns like `code`, `name`, `symbol`, and `locale`. For updates, overwrite the table via a seeder or cron job.
Does this package support currency validation (e.g., rejecting invalid ISO codes)?
The package provides raw data, so validation is manual. Wrap it in a service class to add rules like `CurrencyService::validate('XYZ')` (returns false for invalid codes). For business logic (e.g., blacklisted currencies), extend the class or use Laravel’s Form Request validation.
How do I cache currency data for better performance?
Cache locale-specific data using Laravel’s cache driver. Example: `cache()->remember('currencies_en', now()->addDays(30), fn() => CurrencyList::get('en'))`. Use tagged caching (e.g., `cache()->tags(['currencies'])->put()`) to invalidate when data updates.
Are there alternatives to this package for Laravel currency support?
Yes. For API-based solutions, consider `spatie/currency` (uses an external API) or `moneyphp/money` (for financial calculations). For static data, `league/currency` is another option, but `umpirsky/currency-list` stands out for its CLDR-based localization and zero-dependency approach.
How do I test this package in my Laravel app?
Test edge cases like invalid ISO codes (e.g., `CurrencyList::get('XYZ')` should return null). For localization, verify translations for critical paths (e.g., `CurrencyList::get('fr')` for French). Mock the package in unit tests using PHPUnit’s `partialMock` or a data provider.
Can I extend this package to include historical exchange rates?
The package focuses on static metadata (names/symbols), not rates. For rates, pair it with an API like `exchangerate-api` or a database table for historical data. Use Laravel’s service container to combine both (e.g., `app()->make(CurrencyService::class)`).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware