PHPackages                             denprog/meridian - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. denprog/meridian

ActiveLibrary[Localization &amp; i18n](/categories/localization)

denprog/meridian
================

Simplify internationalization in your Laravel projects with Meridian. Easily manage countries, currencies, exchange rates, languages, and perform GeoIP lookups.

v1.2.2(3mo ago)00MITPHPPHP ^8.3CI passing

Since Jul 15Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/denprog5/meridian)[ Packagist](https://packagist.org/packages/denprog/meridian)[ Docs](https://github.com/denprog5/meridian)[ RSS](/packages/denprog-meridian/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (9)Versions (6)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fb74bfdc44a2a6eaba574b3dd48d8967ac6aeee5d27e4282a54fab7c4e634ba8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64656e70726f672f6d6572696469616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/denprog/meridian)[![Total Downloads](https://camo.githubusercontent.com/e53c40e5ee7213f3c03baf4648b57f0d6b1436828c90d7813c2fc99d2b37ad71/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64656e70726f672f6d6572696469616e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/denprog/meridian)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/f763e2f0a75352111ecb4fb36d046b228712bc4554761d186640dce734f7bcc9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64656e70726f67352f6d6572696469616e2f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/denprog5/meridian/actions)[![Coverage Status](https://camo.githubusercontent.com/59a7c89941c741672dcb3f36395eb556f9540c94819eb3de167f18aa7669c9ff/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f64656e70726f67352f6d6572696469616e2f6d61696e2e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/denprog5/meridian?branch=main)

`Meridian` is a comprehensive Open-Source package for Laravel (11.x, 12.x) designed to provide developers with intuitive tools and structured data for working with countries, continents, currencies (including exchange rates), and languages. Simplify internationalization, localization, and geo-dependent features in your applications with an elegant API and a well-thought-out architecture.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 11.x or 12.x

Compatibility Matrix
--------------------

[](#compatibility-matrix)

MeridianPHPLaravel1.2.x8.3, 8.411.x, 12.xInstallation &amp; Setup
------------------------

[](#installation--setup)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require denprog/meridian
```

### 2. Run the Install Command

[](#2-run-the-install-command)

This command publishes the configuration file and migrations.

```
php artisan meridian:install
```

### 3. Install Core Data

[](#3-install-core-data)

This one-time command seeds the database with essential data for countries, currencies, and languages.

```
php artisan meridian:install-data
```

### 4. Configure Your Environment

[](#4-configure-your-environment)

After publishing, the main configuration file is `config/meridian.php`. For GeoIP lookups, you must get a free MaxMind account and add your credentials to your `.env` file:

```
MAXMIND_ACCOUNT_ID=your_account_id
MAXMIND_LICENSE_KEY=your_license_key
MERIDIAN_GEOIP_DB_SHA256=optional_sha256_checksum
```

### 5. Schedule Data Updates

[](#5-schedule-data-updates)

To keep your data current, define the schedule in your application's `routes/console.php` file.

```
use Illuminate\Support\Facades\Schedule;

// To update the GeoIP database (e.g., weekly)
Schedule::command('meridian:update-geoip-db')->weekly();

// To update currency exchange rates (e.g., daily)
Schedule::command('meridian:update-exchange-rates')->daily();
```

Alternatively, you can define the schedule in your `bootstrap/app.php` file:

```
use Illuminate\Console\Scheduling\Schedule;

->withSchedule(function (Schedule $schedule) {
    $schedule->command('meridian:update-geoip-db')->weekly();
    $schedule->command('meridian:update-exchange-rates')->daily();
})
```

### Artisan Commands

[](#artisan-commands)

Meridian provides several Artisan commands to manage your data:

```
# Install the package (publish config and migrations)
php artisan meridian:install
php artisan meridian:install --force

# Seed the database with countries, currencies, and languages
php artisan meridian:install-data

# Run package health diagnostics
php artisan meridian:doctor
php artisan meridian:doctor --json

# Update GeoIP database
php artisan meridian:update-geoip-db
php artisan meridian:update-geoip-db --dry-run
php artisan meridian:update-geoip-db --retries=5 --retry-delay=1500

# Update exchange rates (with optional parameters)
php artisan meridian:update-exchange-rates
php artisan meridian:update-exchange-rates --base=EUR
php artisan meridian:update-exchange-rates --targets=GBP --targets=JPY
php artisan meridian:update-exchange-rates --date=2025-01-15
php artisan meridian:update-exchange-rates --base=USD --targets=EUR --date=2025-01-15
php artisan meridian:update-exchange-rates --dry-run
php artisan meridian:update-exchange-rates --retries=3 --retry-delay=700
```

**Exchange Rate Command Options:**

- `--base` - Specify the base currency code (default: from config)
- `--targets` - Specify target currencies (can be used multiple times)
- `--date` - Fetch rates for a specific date (format: YYYY-MM-DD)
- `--dry-run` - Validate and print execution plan without updating rates
- `--retries` - Number of retries for failed update attempts
- `--retry-delay` - Delay (ms) between retries
- `--lock-seconds` - Lock lifetime to prevent overlapping runs

**GeoIP Command Options:**

- `--dry-run` - Validate configuration and show execution plan only
- `--retries` - Number of retries for archive download
- `--retry-delay` - Delay (ms) between retries
- `--lock-seconds` - Lock lifetime to prevent overlapping runs

Usage
-----

[](#usage)

Meridian provides a simple and elegant API through facades and global helper functions.

### Country Data

[](#country-data)

```
use Denprog\Meridian\Facades\MeridianCountry;

// Get all countries
$countries = MeridianCountry::all();

// Find a country by its ISO code
$usa = MeridianCountry::findByCode('US');

// Get the default country (based on config)
$default = MeridianCountry::default();

// Get country details
echo MeridianCountry::name(); // United States
echo MeridianCountry::code(); // US
echo MeridianCountry::currencyCode(); // USD
echo MeridianCountry::nativeName(); // United States
echo MeridianCountry::continent()->name(); // North America
echo MeridianCountry::isoAlpha2Code(); // US
echo MeridianCountry::isoAlpha3Code(); // USA
echo MeridianCountry::defaultName(); // United States
echo MeridianCountry::defaultCode(); // US
echo MeridianCountry::defaultCurrencyCode(); // USD
echo MeridianCountry::defaultNativeName(); // United States
```

### Geolocation

[](#geolocation)

```
use Denprog\Meridian\Facades\MeridianGeoLocator;

// Look up an IP address (e.g., from the request)
$location = MeridianGeoLocator::lookup(request()->ip());

if (! $location->isEmpty()) {
    echo 'Country: ' . $location->countryName; // e.g., United States
    echo 'City: ' . $location->cityName; // e.g., Mountain View
}
```

### Currency Management

[](#currency-management)

```
use Denprog\Meridian\Facades\MeridianCurrency;

// Get the current display currency (from session or base currency)
$currentCurrency = MeridianCurrency::get();

// Set the display currency for the user's session
MeridianCurrency::set('EUR');

// Get details of the current currency
echo MeridianCurrency::name(); // Euro
echo MeridianCurrency::code(); // EUR
echo MeridianCurrency::symbol(); // €
echo MeridianCurrency::baseName(); // US Dollar
echo MeridianCurrency::baseCode(); // USD
echo MeridianCurrency::baseSymbol(); // $
```

### Currency Conversion

[](#currency-conversion)

```
use Denprog\Meridian\Facades\MeridianExchangeRate;

// Convert 100 units from the base currency to the current display currency
$convertedAmount = MeridianExchangeRate::convert(100);
$convertedAmount = MeridianExchangeRate::convert(100, true, 'de_DE');

// Convert between two currencies on a specific date.
// Ensure rates for the date are already downloaded.
$convertedBetween = MeridianExchangeRate::convertBetween(100, 'EUR', 'USD', true, '2025-01-01');
```

### Updating Exchange Rates Manually

[](#updating-exchange-rates-manually)

While it's recommended to update rates via the scheduled Artisan command, you can also trigger an update manually using the `MeridianUpdateExchangeRate` facade. This will fetch and save the latest rates for all active currencies defined in your `config/meridian.php` file.

```
use Denprog\Meridian\Facades\MeridianUpdateExchangeRate;
use Illuminate\Support\Carbon;

// Fetches and saves the latest exchange rates for all active currencies.
MeridianUpdateExchangeRate::updateRates();
MeridianUpdateExchangeRate::updateRates('USD', ['GBP'], Carbon::parse('2025-01-01'));
```

### Language Management

[](#language-management)

```
use Denprog\Meridian\Facades\MeridianLanguage;

// Get the current language (from session or config)
$currentLanguage = MeridianLanguage::get();

// Set the current language
MeridianLanguage::set('de');

// Detect browser language and apply it
$browserLanguage = MeridianLanguage::detectBrowserLanguage();
MeridianLanguage::setByBrowserLanguage();
```

### Global Helper Functions

[](#global-helper-functions)

The package also includes lightweight global helpers.

```
// Get service instances
$currencyService = currency();
$countryService = country();
$languageService = language();
$geoService = geoLocation();

// Resolve entities directly
$eur = currency('EUR');
$germany = country('DE');
$german = language('de');

// Resolve geolocation for IP
$location = geoLocation('8.8.8.8');
echo $location->countryName;

// Convert amount using current currency context
$formatted = exchangeRate(100, true);
```

Troubleshooting
---------------

[](#troubleshooting)

- `meridian:doctor` reports missing base/default entities:
    - Run `php artisan meridian:install-data` and verify `config/meridian.php` values.
- GeoIP update fails with authentication/configuration errors:
    - Check `MAXMIND_ACCOUNT_ID`, `MAXMIND_LICENSE_KEY`, and optional `MERIDIAN_GEOIP_DB_SHA256`.
- GeoIP update says lock is already acquired:
    - Wait for the running task to finish or reduce lock time in `meridian.commands.update_geoip_db.lock_seconds`.
- Exchange rate update keeps failing:
    - Run with `--dry-run`, then increase retries (`--retries`, `--retry-delay`) and verify provider URL.
- CI security audit fails:
    - Run `composer security:audit` locally and update vulnerable dependencies.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance82

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Total

5

Last Release

91d ago

PHP version history (2 changes)v1.0PHP ^8.3.0

v1.2.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/30462f9a1fb79c1e5c4f69172d76985246b2c4565b2444046afd443bc2c31690?d=identicon)[denprog](/maintainers/denprog)

---

Top Contributors

[![denprog5](https://avatars.githubusercontent.com/u/107854071?v=4)](https://github.com/denprog5 "denprog5 (140 commits)")

---

Tags

phplaravelgeoiplocalizationinternationalizationi18nlanguagespackagecountriesexchange ratescurrenciesMeridian

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/denprog-meridian/health.svg)

```
[![Health](https://phpackages.com/badges/denprog-meridian/health.svg)](https://phpackages.com/packages/denprog-meridian)
```

###  Alternatives

[nnjeim/world

Laravel countries, states, cities, currencies, languages and IP geolocation

970361.2k3](/packages/nnjeim-world)[gettext/languages

gettext languages with plural rules

7530.3M11](/packages/gettext-languages)[punic/punic

PHP-Unicode CLDR

1542.9M29](/packages/punic-punic)[pmochine/laravel-tongue

🎉 Finally a subdomain localization that works how you want it to work. 🌐

4158.4k](/packages/pmochine-laravel-tongue)[jayesh/laravel-gemini-translator

An interactive command to extract and generate Laravel translations using Gemini AI.

691.7k1](/packages/jayesh-laravel-gemini-translator)[smousss/laravel-globalize

Make Laravel projects translatable in a matter of seconds!

2266.3k](/packages/smousss-laravel-globalize)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
