PHPackages                             placecodex/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. placecodex/laravel-countries

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

placecodex/laravel-countries
============================

A list of all countries, optimized for Laravel 8

3.1.1(5y ago)05MITPHPPHP ^7.3|^8.0

Since Nov 20Pushed 4y agoCompare

[ Source](https://github.com/placecodex/laravel-countries)[ Packagist](https://packagist.org/packages/placecodex/laravel-countries)[ Docs](https://github.com/lwwcas/laravel-countries)[ RSS](/packages/placecodex-laravel-countries/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

[![](https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/map.jpg)](https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/map.jpg)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4c637c8d8e038c4653bb1cdae313e4efc4823a2170e5e38fa6e0e498f432290f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c77776361732f6c61726176656c2d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lwwcas/laravel-countries)[![Total Downloads](https://camo.githubusercontent.com/4b941b6d2fceb146c76bddf06b37eb5ada29d8456ba3571ecfea23dff46cd877/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c77776361732f6c61726176656c2d636f756e74726965732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lwwcas/laravel-countries)

Very short description
======================

[](#very-short-description)

Laravel-Countries, is a package that contains everything you need to start a new project and have all countries, information and translations on hand. **And all this optimized for Laravel 8.**

The package provides all data directly to your database, allowing you to link to any other table in your database, in a simple and usual way.

[![](https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/EER-countries.png)](https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/EER-countries.png)

### Geology and topology maps

[](#geology-and-topology-maps)

Amongst many other information you'll be able to plot country maps:

[![](https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/brazil-map.png)](https://raw.githubusercontent.com/lwwcas/laravel-countries/master/assets/brazil-map.png)

### Available Languages?

[](#available-languages)

LanguageEnglishPortugueseSpanishItalianRequirements
------------

[](#requirements)

- [PHP](https://github.com/php) &gt;= ^7.3 | ^8.0
- [laravel/framework](https://github.com/laravel/framework) &gt;= ^8.12
- [dimsav/laravel-translatable](https://github.com/Astrotomic/laravel-translatable) &gt;= ^11.8

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require lwwcas/laravel-countries
composer dump-autoload
```

- Put this line into database\\seeds\\DatabaseSeeder.php in run function

```
$this->call(\Lwwcas\LaravelCountries\Database\Seeders\LcDatabaseSeeder::class);
```

- Run migrations

```
php artisan migrate
```

- Run seeds or only the LcDatabaseSeeder class

```
php artisan db:seed
```

Usage
-----

[](#usage)

You can access all the information in the database with a simple query

```
use  Lwwcas\LaravelCountries\Models\Country;

Country::whereIso('BR')->first();
Country::whereIsoAlpha3('BRA')->first();
Country::whereSlug('brasil')->first();
```

[![](https://raw.githubusercontent.com/lwwcas/laravel-countries/dddd6f3d6c0e6cc0a0e4f761c8d900ce244a52eb/assets/contry_model.svg)](https://raw.githubusercontent.com/lwwcas/laravel-countries/dddd6f3d6c0e6cc0a0e4f761c8d900ce244a52eb/assets/contry_model.svg)

How to integrate into my project?
---------------------------------

[](#how-to-integrate-into-my-project)

In your table you can simply add the foreign key.

> Only this will allow you to make a relationship with the country table

```
$table->integer('lc_country_id')->unsigned();
```

Being optional, but **strongly recommended**, you should use the [Foreign Key Constraints](https://laravel.com/docs/8.x/migrations#foreign-key-constraints) that Laravel provides.

```
$table->foreign('lc_country_id')->references('id')->on('lc_countries');
```

### Example of implementation in the users table

[](#example-of-implementation-in-the-users-table)

[![](https://raw.githubusercontent.com/lwwcas/laravel-countries/dddd6f3d6c0e6cc0a0e4f761c8d900ce244a52eb/assets/user_table_add_lines.svg)](https://raw.githubusercontent.com/lwwcas/laravel-countries/dddd6f3d6c0e6cc0a0e4f761c8d900ce244a52eb/assets/user_table_add_lines.svg)

#### To make a relationship with the regions table

[](#to-make-a-relationship-with-the-regions-table)

```
$table->tinyInteger('lc_region_id')->unsigned();
$table->foreign('lc_region_id')->references('id')->on('lc_regions');
```

Take a good look at the Model and see the package makes it easy
---------------------------------------------------------------

[](#take-a-good-look-at-the-model-and-see-the-package-makes-it-easy)

[Country](https://github.com/lwwcas/laravel-countries/blob/master/src/models/Country.php)

[CountryTranslation](https://github.com/lwwcas/laravel-countries/blob/master/src/models/CountryTranslation.php)

[CountryRegion](https://github.com/lwwcas/laravel-countries/blob/master/src/models/CountryRegion.php)

[CountryRegionTranslation](https://github.com/lwwcas/laravel-countries/blob/master/src/models/CountryRegionTranslation.php)

[CountryGeographical](https://github.com/lwwcas/laravel-countries/blob/master/src/models/CountryGeographical.php)

### Example data

[](#example-data)

```
{
  "id": 30,
  "lc_region_id": 2,
  "uuid": "343d2082-f6fb-42e6-ac7a-f78dad39de31",
  "slug": "brazil",
  "name": "Brazil",
  "official_name": "Federative Republic of Brazil",
  "iso_alpha_2": "BR",
  "iso_alpha_3": "BRA",
  "iso_numeric": 76,
  "geoname_id": "3469034",
  "international_phone": "55",
  "languages": "[pt]",
  "tld": "[.br]",
  "wmo": "BZ",
  "emoji": {
    "img": "🇧🇷",
    "uCode": "U+1F1E7 U+1F1F7"
  },
  "color_hex": [
    "#008000",
    "#ffff00"
  ],
  "color_rgb": [
    "0,128,0",
    "255,255,0"
  ],
  "coordinates": {
    "latitude": {
      "classic": "10 00 S",
      "desc": "-10.81045150756836"
    },
    "longitude": {
      "classic": "55 00 W",
      "desc": "-52.97311782836914"
    }
  },
  "coordinates_limit": {
    "latitude": {
      "max": "5.266667",
      "min": "-33.733333"
    },
    "longitude": {
      "max": "-28.85",
      "min": "-73.75"
    }
  },
  "visible": true,
  "translations": [
    {
      "id": 30,
      "lc_country_id": 30,
      "name": "Brazil",
      "slug": "brazil",
      "locale": "en"
    }
  ]
}
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Lucas Duarte](https://github.com/lwwcas)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 90.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

3

Last Release

1995d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a01bd655fccd3a96135c41ad8609666ee68c0d8bf30b5d0f0ce9f501b5dac9d5?d=identicon)[placecodex](/maintainers/placecodex)

---

Top Contributors

[![lwwcas](https://avatars.githubusercontent.com/u/19727953?v=4)](https://github.com/lwwcas "lwwcas (19 commits)")[![placecodex](https://avatars.githubusercontent.com/u/25695369?v=4)](https://github.com/placecodex "placecodex (2 commits)")

---

Tags

laravelcountrieslwwcaslucas duarteLaravel-Countries

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[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.

12464.0k](/packages/lwwcas-laravel-countries)[pragmarx/countries-laravel

Countries for Laravel

1471.1M2](/packages/pragmarx-countries-laravel)[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)[forxer/laravel-gravatar

A library providing easy gravatar integration in a Laravel project.

4235.6k](/packages/forxer-laravel-gravatar)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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