LaravelPackages.net
Acme Inc.
Toggle sidebar
merrick/laravel-shopify-currencies

Laravel package providing the full list of Shopify supported currencies (hardcoded from CurrencyCode enum)

2
0
1.1.0
About merrick/laravel-shopify-currencies

merrick/laravel-shopify-currencies is a Laravel package for laravel package providing the full list of shopify supported currencies (hardcoded from currencycode enum). It currently has 0 GitHub stars and 2 downloads on Packagist (latest version 1.1.0). Install it with composer require merrick/laravel-shopify-currencies. Discover more Laravel packages by merrick or browse all Laravel packages to compare alternatives.

Last updated

Merrick Laravel Shopify Currencies

Packagist Version Downloads

A lightweight Laravel package that provides the full list of currencies supported by Shopify, hardcoded from the official CurrencyCode enum (Shopify GraphQL Admin/Storefront APIs, latest 2026-01).

This package includes:

  • Currency code, full name, symbol, and display format (e.g., "Vietnamese Dong (VND ₫)", "US Dollar (USD $)").
  • Sorted like Shopify Admin dropdown: Most used currencies first (USD, EUR, GBP, CAD, AUD, etc.), then alphabetical by name.
  • No database, no migrations, no API calls – pure PHP enum + static data for maximum speed and reliability.

Perfect for:

  • Currency dropdowns in forms
  • Validation rules
  • Payment or checkout features
  • Matching Shopify Admin settings exactly

Requirements

  • PHP ^8.1 | ^8.2 | ^8.3
  • Laravel ^9.0 | ^10.0 | ^11.0 | ^12.0 (illuminate/support)

Installation

Install via Composer (live on Packagist):

composer require merrick/laravel-shopify-currencies

For local development or testing:

Add to your project's composer.json:

"repositories": [ { "type": "vcs", "url": "https://github.com/merrick67/laravel-shopify-currencies" } ], "require": { "merrick/laravel-shopify-currencies": "dev-main" }

Then run:

composer update merrick/laravel-shopify-currencies

No additional setup needed – auto-registered.

Usage

use Merrick\ShopifyCurrencies\Facades\ShopifyCurrencies;

// All codes as array $codes = ShopifyCurrencies::codes();

// Full collection (code, name, symbol, display – sorted like Shopify Admin) $currencies = ShopifyCurrencies::all(); // Example items: // ['code' => 'USD', 'name' => 'US Dollar', 'symbol' => '$', 'display' => 'US Dollar (USD $)'] // ['code' => 'EUR', 'name' => 'Euro', 'symbol' => '€', 'display' => 'Euro (EUR €)'] // ['code' => 'VND', 'name' => 'Vietnamese Dong', 'symbol' => '₫', 'display' => 'Vietnamese Dong (VND ₫)']

// Validate code $isValid = ShopifyCurrencies::isValid('VND'); // true

2. Via Helpers

$codes = shopify_currency_codes(); $currencies = shopify_currencies(); // with display format $isValid = is_shopify_currency('EUR');

3. Via Service Container

use Merrick\ShopifyCurrencies\Services\ShopifyCurrencyService;

$service = app(ShopifyCurrencyService::class); $currencies = $service->all();

Blade Dropdown Example (Matches Shopify Admin Style)

Output preview:

  • US Dollar (USD $)
  • Euro (EUR €)
  • British Pound (GBP £)
  • ...
  • Vietnamese Dong (VND ₫)

Available Methods

Method | Return Type | Description
-------------------------------|-------------------|----------------------------------------------------------------------------- codes() | array | All currency codes
all() | Collection | Full list: code, name, symbol, display (Most used first)
isValid(string $code) | bool | Check if code is supported by Shopify

Why Hardcoded?

Shopify's CurrencyCode enum is stable and rarely changes. Hardcoding ensures:

  • No API dependencies
  • Instant performance
  • Easy maintenance (update maps in ShopifyCurrencyService.php)

Version History

  • 1.1.0 (latest): Added full names, symbols, display format ("Name (CODE symbol)"), and "Most used" sorting to match Shopify Admin dropdown.
  • 1.0.0: Initial release with basic code + name list.

Contributing

Report issues, suggest symbols/names, or open PRs on GitHub: https://github.com/merrick67/laravel-shopify-currencies

License

MIT License

See LICENSE for details.

Comments