PHPackages                             zalanihir/country-state-city - 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. zalanihir/country-state-city

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

zalanihir/country-state-city
============================

Laravel package for country, state, city providers with the flags

v1.1.0(1y ago)267.1k↓33.3%[2 issues](https://github.com/ZalaNihir/country-state-city-package/issues)MITPHP

Since Feb 4Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/ZalaNihir/country-state-city-package)[ Packagist](https://packagist.org/packages/zalanihir/country-state-city)[ RSS](/packages/zalanihir-country-state-city/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

Laravel Country-State-City Seeder
=================================

[](#laravel-country-state-city-seeder)

[![Packagist Version](https://camo.githubusercontent.com/d8aa3cb44aebd8a6a4b59098cf87a594c4216347267d8ae5e3165f762ccbe00f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a616c616e696869722f636f756e7472792d73746174652d636974793f6c6162656c3d7061636b6167697374266c6f676f3d7061636b6167697374)](https://packagist.org/packages/zalanihir/country-state-city)

Lightweight Laravel package to seed Countries, States and Cities with model relationships and optional country flags.

[![Seeder preview](images/country-state-city-seeder.png)](images/country-state-city-seeder.png)

What you'll get:

- Seeders and migrations for Country, State and City models
- Pre-defined model relationships (Country -&gt; State -&gt; City)
- Optional ISO codes (iso2, iso3), numeric code, phone code and country flags

Why use it?

- Open source and free
- Easy to install and modify
- Works out of the box with Laravel

Requirements

- PHP 8.1+ (or the version required by your Laravel application)
- Laravel 9 / 10 / 11

Quick installation

Install via Composer:

```
composer require zalanihir/country-state-city
```

Register the service provider (only if your Laravel version requires manual registration):

- Laravel 9 / 10: add this to `config/app.php` providers array:

```
\Nihir\CountryStateCity\CountryStateCityServiceProvider::class,
```

- Laravel 11: add this to `bootstrap/app/providers.php` (if applicable):

```
\Nihir\CountryStateCity\CountryStateCityServiceProvider::class,
```

Publish package files and flags:

```
php artisan vendor:publish --provider="Nihir\CountryStateCity\CountryStateCityServiceProvider"
php artisan csc:publish-flags
```

Run migrations and seeders:

```
php artisan migrate
```

Add the seeder call to `DatabaseSeeder.php`:

```
$this->call(CountryStateCityTableSeeder::class);
```

Then run:

```
php artisan db:seed
```

Notes

- If you already have Country/State/City models or migrations in your project, remove or rename them to avoid conflicts before running the package migrations.
- The package fetches flags from  (64px). If some flags are missing you can contribute missing images in the `flags/` folder.

Usage example (display flags):

```
use App\Models\Country;

$countries = Country::all();

foreach ($countries as $country) {
    echo '';
}
```

Support

If you find issues or need help, email:

Connect with me

[![Twitter](https://camo.githubusercontent.com/7b35a73a0c684657ac55011cca8282d7533d733b705374ee6a3956f9bde18ade/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466f6c6c6f772532302534304e696869725a616c612d3144413146323f7374796c653d666c61742d737175617265266c6f676f3d74776974746572266c6f676f436f6c6f723d7768697465)](https://twitter.com/NihirZala)[![LinkedIn](https://camo.githubusercontent.com/f4c80e061a77cff3b3f6178eec78459e502cab9fd4691ed4545e61d8bf91fe64/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e6e6563742532302534306e696869727a616c612d3030373742353f7374796c653d666c61742d737175617265266c6f676f3d6c696e6b6564696e266c6f676f436f6c6f723d7768697465)](https://www.linkedin.com/in/nihirzala/)[![Instagram](https://camo.githubusercontent.com/513558f94fffbce5cf3237bd5c193bed15106dbf8f737195fd6c3b1828467f7f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466f6c6c6f77253230253430696e696869727a616c612d6666363962343f7374796c653d666c61742d737175617265266c6f676f3d696e7374616772616d266c6f676f436f6c6f723d7768697465)](https://www.instagram.com/inihirzala/)

Contributors

Thanks to everyone who contributed!

   [ ![Nihir Zala](https://avatars.githubusercontent.com/u/157243660?v=4)
 **Zala Nihir** ](https://github.com/ZalaNihir)  Want to contribute? See [CONTRIBUTING.md](CONTRIBUTING.md).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance46

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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 ~300 days

Total

2

Last Release

581d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fee93ef85616535d5f500cc9b43be18571e696bd0e2535a49fe849037204363?d=identicon)[ZalaNihir](/maintainers/ZalaNihir)

---

Top Contributors

[![ZalaNihir](https://avatars.githubusercontent.com/u/157243660?v=4)](https://github.com/ZalaNihir "ZalaNihir (13 commits)")

### Embed Badge

![Health badge](/badges/zalanihir-country-state-city/health.svg)

```
[![Health](https://phpackages.com/badges/zalanihir-country-state-city/health.svg)](https://phpackages.com/packages/zalanihir-country-state-city)
```

###  Alternatives

[thomaspark/bootswatch

Themes for Bootstrap

14.8k268.8k14](/packages/thomaspark-bootswatch)

PHPackages © 2026

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