PHPackages                             php-monsters/laravel-worldwide - 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. [Database &amp; ORM](/categories/database)
4. /
5. php-monsters/laravel-worldwide

ActiveLibrary[Database &amp; ORM](/categories/database)

php-monsters/laravel-worldwide
==============================

Laravel Worldwide, Countries States Cities DB Migration &amp; Seeder

028[3 PRs](https://github.com/php-monsters/laravel-worldwide/pulls)PHPCI passing

Since Oct 13Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/php-monsters/laravel-worldwide)[ Packagist](https://packagist.org/packages/php-monsters/laravel-worldwide)[ RSS](/packages/php-monsters-laravel-worldwide/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

```
██████╗ ██╗  ██╗██████╗     ███╗   ███╗ ██████╗ ███╗   ██╗███████╗████████╗███████╗██████╗ ███████╗
██╔══██╗██║  ██║██╔══██╗    ████╗ ████║██╔═══██╗████╗  ██║██╔════╝╚══██╔══╝██╔════╝██╔══██╗██╔════╝
██████╔╝███████║██████╔╝    ██╔████╔██║██║   ██║██╔██╗ ██║███████╗   ██║   █████╗  ██████╔╝███████╗
██╔═══╝ ██╔══██║██╔═══╝     ██║╚██╔╝██║██║   ██║██║╚██╗██║╚════██║   ██║   ██╔══╝  ██╔══██╗╚════██║
██║     ██║  ██║██║         ██║ ╚═╝ ██║╚██████╔╝██║ ╚████║███████║   ██║   ███████╗██║  ██║███████║
╚═╝     ╚═╝  ╚═╝╚═╝         ╚═╝     ╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚══════╝   ╚═╝   ╚══════╝╚═╝  ╚═╝╚══════╝

```

Php Monsters Laravel Worldwide
==============================

[](#php-monsters-laravel-worldwide)

This package will allow you to add all Countries, States, Cities' Data DB Migration &amp; Seeder for Laravel 10+

[![Latest Version on Packagist](https://camo.githubusercontent.com/1f19e6ff157df231e29a82c2fa8a40b790fbb8f1c7f26f1e564d6b387616418b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068702d6d6f6e73746572732f6c61726176656c2d776f726c64776964652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/php-monsters/laravel-worldwide)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6c197460fac8cbff62ba7d70b758730e9358adde9e38d48627ce2805c8d3f043/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d6d6f6e73746572732f6c61726176656c2d776f726c64776964652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/php-monsters/laravel-worldwide/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/344b7306fdeab3560bfcccfc0b41d02b08d05790712b200f0e489b501bb8f37a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d6d6f6e73746572732f6c61726176656c2d776f726c64776964652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/php-monsters/laravel-worldwide/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/749a357a0e7414ad877a94710cea90bdd369053840eacadc04b870172a6ab6d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068702d6d6f6e73746572732f6c61726176656c2d776f726c64776964652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/php-monsters/laravel-worldwide)

Number of entity records
------------------------

[](#number-of-entity-records)

ModelNumber of itemsCountry250State4961City148059Attributes
----------

[](#attributes)

Common attributes:

- `name`: Common name of Country (English).
- `iso2`: ISO-3166-2 code.
- `iso2`: ISO-3166-3 code.
- `numeric_code`: Country Numeric code.
- `phonecode`: Country Phone code.
- `capital`: Capital of this country.
- `currency`: ISO-4177 Currency Code, e.g., USD, CNY.
- `currency_name`: Currency Name.
- `currency_symbol`: Currency Symbol e.g. $, ¥.
- `tld`: Country code top-level domain e.g..uk.
- `native`: Local name of the country.
- `region`: region of the country.
- `subregion`: Subregion of the country.
- `timezones`: timezones the country.
    - `zoneName`: Zone Name e.g., America/New\_York.
    - `gmtOffset`: GMT offset e.g. -18000.
    - `gmtOffsetName`: GMT offset Name e.g., UTC-05:00.
    - `abbreviation`: abbreviation e.g. EST.
    - `tzName`: time zone Name e.g., Eastern Standard Time (North America).
- `translations`: Country name translations e.g.
    - "ar": "الولايات المتحدة الأمريكية"
    - "kr": "미국"
    - "fr": "États-Unis"
- `latitude`: latitude the country.
- `longitude`: latitude the country.
- `emoji`: Emoji flag of country e.g. 🇺🇸.
- `emojiU`: Emoji Unicode flag of country e.g., U+1F1FA U+1F1F8.
- `flag`: Country has flag (boolean).
- `is_active`: Country has active (boolean).

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

[](#installation)

You can install the package via composer:

```
composer require php-monsters/laravel-worldwide
```

Usage
-----

[](#usage)

Now run the following command to install.

```
php artisan worldwide:install
```

Add seeder File in `database\seeders\DatabaseSeeder.php` add this line to use `php artisan db:seed` command.

```
public function run(): void
    {
        $this->call(WorldTableSeeder::class);
        ...
    }
```

Or you can Seed Data of Countries, States and Cities, by run this command.

```
php artisan world:seeder
```

And you can refresh to re-seeding Data of Countries, States and Cities, by run this command.

```
php artisan world:seeder --refresh
```

You can specify the activation of countries through the country code ISO2 or ISO3, before processing the seed data in the config file. `config/worldwide.php`

```
return [
    'insert_activations_only' => false,
    'countries' => [
        'activation' => [
            'default' => true,
            'only' => [
                'iso2' => ['SA','GB','DE'],
                'iso3' => ['USA','BRA','EGY'],
            ],
            'except' => [
                'iso2' => ['GA'],
                'iso3' => ['HTI'],
            ],
        ],
        'chunk_length' => 50,
    ],

    'states' => [
        'activation' => [
            'default' => true,
        ],
        'chunk_length' => 200,
    ],

    'cities' => [
        'activation' => [
            'default' => true,
        ],
        'chunk_length' => 200,
    ],
];
```

If you need to insert the countries is activation, this insert only two Countries `( Albania , Argentina )` with States and Cities.

```
return [
    'insert_activations_only' => true,
    'countries' => [
        'activation' => [
            'default' => true,
            'only' => [
                'iso2' => ['AL','AR'],
                'iso3' => [],
            ],
            'except' => [
                'iso2' => [],
                'iso3' => [],
            ],
        ],
        'chunk_length' => 50,
    ],

    ...
];
```

This means that only these two countries and the states and cities affiliated with them will be activated.

- Note: If activation only `iso2` an `iso3` are empty, the column is\_active take the `default` value in a config file.
- Note: If the Country is active, all States and Cities are active.
- Note: If activation except `iso2` or `iso3` the column is\_active take FALSE value.
- Note: If the Country is not active, all States and Cities are not active.

Usage
-----

[](#usage-1)

you can get country by iso2 and iso3 or both.

if you want to get country by iso2 you can yes static function getByIso2

```
use App\Models\Country;

$sa = Country::getByIso2('IR');
$sa->name; // Iran
$sa->iso2; // IR
$sa->iso3; // IRN
$sa->currency_symbol; // ﷼
$sa->native; // ایران
```

if you want to get country by iso3 you can use.

```
use App\Models\Country;

$bra = Country::getByIso3('BRA');
$bra->name; // Brazil
$bra->iso2; // BR
$bra->iso3; // BRA
$bra->currency_symbol; // R$
$bra->native; // Brasil
```

also if you want to get country by code iso2 ro iso3 you can use.

```
use App\Models\Country;

$bra = Country::getByCode('PT');
$bra->name; // Portugal
$bra->iso2; // PT
$bra->iso3; // PRT
$bra->currency_symbol; // €
$bra->native; // Portugal
```

### Scope

[](#scope)

you can use Scope to filter data is Active by use.

```
use App\Models\Country;

$countries = Country::active()->pluck('name','id');
```

Credits
-------

[](#credits)

- [Aboozar Ghaffari](https://github.com/samuraee)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance57

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![samuraee](https://avatars.githubusercontent.com/u/502961?v=4)](https://github.com/samuraee "samuraee (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

### Embed Badge

![Health badge](/badges/php-monsters-laravel-worldwide/health.svg)

```
[![Health](https://phpackages.com/badges/php-monsters-laravel-worldwide/health.svg)](https://phpackages.com/packages/php-monsters-laravel-worldwide)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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