PHPackages                             indeximstudio/laravel-countries\_new - 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. indeximstudio/laravel-countries\_new

ActiveLibrary

indeximstudio/laravel-countries\_new
====================================

A list of all countries, optimized for Laravel 9

4(3y ago)030MITPHPPHP ^7.3|^8.0

Since Sep 30Pushed 3y agoCompare

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

READMEChangelog (1)Dependencies (6)Versions (2)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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1321d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelcountrieslwwcaslucas duarteLaravel-Countries

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[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)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[igaster/laravel_cities

Seed all countries/cities from geonames.org database. Searchable DB tree, ready to use API &amp; a bonus vue.js component!

17988.7k1](/packages/igaster-laravel-cities)

PHPackages © 2026

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