PHPackages                             aaix/laravel-countries - 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. aaix/laravel-countries

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

aaix/laravel-countries
======================

A modern Laravel country-data package: idempotent seeders, zero-touch install, no interactive commands. Opinionated fork of lwwcas/laravel-countries.

v1.0.5(1mo ago)064[1 issues](https://github.com/jonaaix/laravel-countries/issues)MITPHPPHP ^8.2CI passing

Since Apr 24Pushed 1mo agoCompare

[ Source](https://github.com/jonaaix/laravel-countries)[ Packagist](https://packagist.org/packages/aaix/laravel-countries)[ RSS](/packages/aaix-laravel-countries/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (7)Versions (7)Used By (0)

 [ ![Laravel Countries Logo](https://raw.githubusercontent.com/jonaaix/laravel-countries/main/assets/laravel-countries.webp) ](https://github.com/jonaaix/laravel-countries)

Laravel Countries
=================

[](#laravel-countries)

A modern Laravel country-data package — idempotent seeders, zero-touch install, ergonomic API.

Opinionated fork of [lwwcas/laravel-countries](https://github.com/lwwcas/laravel-countries).

 [![Latest Version on Packagist](https://camo.githubusercontent.com/063394beb0c0bb933a5745c9d021fe8c4091460c7079ccf254361de3c49db8dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616169782f6c61726176656c2d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aaix/laravel-countries) [![Total Downloads](https://camo.githubusercontent.com/f061be6f9a0221aca92fd0bdf6176b53c355ccea69692a49e2a03e7e7b78016c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616169782f6c61726176656c2d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aaix/laravel-countries) [![GitHub Actions](https://camo.githubusercontent.com/89e98ce01a86f9454753897109e0b87d0481cb6021ea1f53996e963fe1c5b96a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a6f6e616169782f6c61726176656c2d636f756e74726965732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/jonaaix/laravel-countries/actions/workflows/tests.yml) [![License](https://camo.githubusercontent.com/277a7d88854493f66ee03c28cd4ad056e8d4391f05ea4d904970beb04c4675a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616169782f6c61726176656c2d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://github.com/jonaaix/laravel-countries/blob/main/LICENSE.md)

---

Install
-------

[](#install)

```
composer require aaix/laravel-countries
php artisan migrate
```

Migrations load automatically via the package service provider.

Seed
----

[](#seed)

```
php artisan db:seed --class="Aaix\\LaravelCountries\\Database\\Seeders\\DatabaseSeeder"
```

Seeds 5 regions, 245 countries, 9 language translations and the `native_name` column. Idempotent — safe to re-run. See [Seeding](https://jonaaix.github.io/laravel-countries/seeding) for deploy-pipeline integration.

Principle
---------

[](#principle)

A country-data package should do exactly two things: **create the tables** and **keep the rows in sync**. Three commands (`composer require`, `php artisan migrate`, `php artisan db:seed`) do both. The seeders are idempotent, so running them on every deploy keeps rows in sync with no extra wiring.

Migrating from `lwwcas/laravel-countries`
-----------------------------------------

[](#migrating-from-lwwcaslaravel-countries)

Same 7-table schema, same Eloquent models, same query scopes, same country data. Migration is mostly a namespace swap — see the step-by-step guide in the docs:

**→ [Migrating from lwwcas](https://jonaaix.github.io/laravel-countries/migrating)**

Usage
-----

[](#usage)

```
use Aaix\LaravelCountries\Models\Country;

// Lookup
$de = Country::getByCode('DE');             // alpha-2, case-insensitive
$de = Country::whereIsoAlpha3('DEU')->first();
$de = Country::whereIso('276')->first();    // matches alpha-2, alpha-3, or numeric

// Names
$de->name;                                  // current app locale, falls back to config fallback
$de->nameInLang('ja');                      // "Germany" (falls back if 'ja' missing)
$de->official_name;                         // "Federal Republic of Germany"
$de->native_name;                           // "Deutschland"

// Bulk localized list — ready for dropdowns
Country::listInLang('de');
// Collection(['DE' => 'Deutschland', 'FR' => 'Frankreich', ...] sorted by name)

// Flag
$de->getFlagEmoji();                        // 🇩🇪
$de->flag_colors_hex;                       // ['#000000', '#DD0000', '#FFCE00']

// Relations
$de->region;                                // CountryRegion
$de->coordinates;                           // CountryCoordinates
$de->extras;                                // CountryExtras (religions, orgs, sports, internet stats)
$de->geographical;                          // CountryGeographical (GeoJSON)
```

Available query scopes: `whereIso`, `whereIsoAlpha2`, `whereIsoAlpha3`, `whereIsoNumeric`, `whereCurrency`, `whereBorders`, `whereDomain`, `whereLanguages`, `whereFlagColors`, `wherePhoneCode`, `whereIndependenceDay`, `whereStatistics`, `whereName`, `whereSlug`, `whereWmo`.

Table layout
------------

[](#table-layout)

TablePurpose`lc_regions`5 continents (Africa, Americas, Asia, Europe, Oceania)`lc_region_translations`Region names per locale`lc_countries`245 countries — ISO codes, capital, currency, flag metadata, `native_name`, population, GDP etc.`lc_countries_translations`Country name + slug per locale`lc_countries_coordinates`Latitude/longitude and formatted coordinate variants`lc_countries_geographical`Country outline as GeoJSON`lc_countries_extras`Religions, international orgs, national sport, internet stats, cybersecurity agencyTranslations are handled by [`astrotomic/laravel-translatable`](https://github.com/Astrotomic/laravel-translatable) (already a dependency). The `withTranslation()` global scope eager-loads the current locale + fallback locale — so `Country::all()->pluck('name')` is one query, not N+1.

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

[](#requirements)

- PHP 8.2+
- Laravel 11+

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Lucas Duarte](https://github.com/lwwcas) — original package author, country-data curator
- [Jonas Gnioui](https://github.com/jonaaix) — fork maintainer

License
-------

[](#license)

MIT. See [LICENSE.md](LICENSE.md).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance92

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.5% 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 ~1 days

Total

6

Last Release

39d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d8ec042829e0d4060243b6c1067768dd31773ace52982c6ac4a4fbef207cbfd?d=identicon)[aaix](/maintainers/aaix)

---

Top Contributors

[![lwwcas](https://avatars.githubusercontent.com/u/19727953?v=4)](https://github.com/lwwcas "lwwcas (80 commits)")[![jonaaix](https://avatars.githubusercontent.com/u/15804690?v=4)](https://github.com/jonaaix "jonaaix (18 commits)")[![daniel-de-wit](https://avatars.githubusercontent.com/u/3015394?v=4)](https://github.com/daniel-de-wit "daniel-de-wit (3 commits)")[![muhannadalhariri](https://avatars.githubusercontent.com/u/37214752?v=4)](https://github.com/muhannadalhariri "muhannadalhariri (1 commits)")[![myindexlike](https://avatars.githubusercontent.com/u/16356381?v=4)](https://github.com/myindexlike "myindexlike (1 commits)")[![vadimwe](https://avatars.githubusercontent.com/u/2635452?v=4)](https://github.com/vadimwe "vadimwe (1 commits)")[![hnasiry](https://avatars.githubusercontent.com/u/14115146?v=4)](https://github.com/hnasiry "hnasiry (1 commits)")[![mucenica-bogdan](https://avatars.githubusercontent.com/u/846097?v=4)](https://github.com/mucenica-bogdan "mucenica-bogdan (1 commits)")

---

Tags

laravelgeolocationmultilingualcountrieslaravel-packagegeographycoordinatesISO codesgeojsoncountry dataworld countries

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aaix-laravel-countries/health.svg)

```
[![Health](https://phpackages.com/badges/aaix-laravel-countries/health.svg)](https://phpackages.com/packages/aaix-laravel-countries)
```

###  Alternatives

[lwwcas/laravel-countries

A comprehensive package for managing country data in Laravel applications, including multilingual support, geographic coordinates, and detailed metadata for seamless integration with Laravel.

12871.9k](/packages/lwwcas-laravel-countries)[unopim/unopim

UnoPim Laravel PIM

10.1k2.2k](/packages/unopim-unopim)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.4k](/packages/typicms-base)[jayesh/laravel-gemini-translator

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

712.2k1](/packages/jayesh-laravel-gemini-translator)[mominalzaraa/filament-localization

The first and only automatic Filament localization package with intelligent resource scanning, structured translation files, and comprehensive testing

101.6k](/packages/mominalzaraa-filament-localization)

PHPackages © 2026

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