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

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

jaynilsavani/laravel-country-state-city
=======================================

Laravel country, state and city collection.

1.1.0(4y ago)158359MITPHPPHP ^7.3

Since Jun 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jaynilsavani/laravel-country-state-city)[ Packagist](https://packagist.org/packages/jaynilsavani/laravel-country-state-city)[ RSS](/packages/jaynilsavani-laravel-country-state-city/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Laravel Country, State and City
===============================

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

[![Total Downloads](https://camo.githubusercontent.com/88dfe96be02df199c5ec9e918e21c9663a54ea55e20696622b443f4d2ce652f1/68747470733a2f2f706f7365722e707567782e6f72672f6a61796e696c736176616e692f6c61726176656c2d636f756e7472792d73746174652d636974792f646f776e6c6f6164732e737667)](https://packagist.org/packages/jaynilsavani/laravel-country-state-city) [![License](https://camo.githubusercontent.com/2806636250ea57de46fbbaea95fb5a154fda30192ea07b8beea11e9cb500f4d8/68747470733a2f2f706f7365722e707567782e6f72672f6a61796e696c736176616e692f6c61726176656c2d636f756e7472792d73746174652d636974792f6c6963656e73652e737667)](https://poser.pugx.org/jaynilsavani/laravel-country-state-city/license.svg)

World's Country, State and City Provider for Laravel.

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

[](#installation)

Run a command for Laravel 8,

```
composer require jaynilsavani/laravel-country-state-city:1.0.0

```

Run a command for Laravel 7,

```
composer require jaynilsavani/laravel-country-state-city:1.1.0

```

To publish configurations,

```
php artisan world:publish

```

Usage
-----

[](#usage)

To get all the data from Country:

```
use App\Models\Country;

// To get all the countries
$countries = Country::all();

// To get all the states from country
$states = Country::where('name','india')->first()->states;
$stateNames = Country::where('name','india')->first()->states->pluck('name');

// To get all the cities from country
$cities = Country::where('name','india')->first()->cities;
$cityNames = Country::where('name','india')->first()->cities->pluck('name');
```

To get all the data from State:

```
use App\Models\State;

// Retrieve all the states
$states = State::all();

// Retrieve country of any state
$country = State::where('name','quebec')->first()->country;

// Retrieve all the cities of any state
$cities = State::where('name','quebec')->first()->cities;
```

To get all the data from City:

```
use App\Models\City;

// Retrieve all the cities
$cities = City::all();

// Retrieve state of any city
$state = City::where('name','montreal')->first()->state;

// Retrieve country of any city
$country = City::where('name','montreal')->first()->state->country;
```

License
-------

[](#license)

This package is licensed under the `MIT` License. Please see the [License File](https://github.com/jaynilsavani/laravel-country-state-city/blob/master/LICENSE) for more details.

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/jaynilsavani/laravel-country-state-city/blob/master/CODE_OF_CONDUCT.md) for details.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~218 days

Total

2

Last Release

1569d ago

### Community

Maintainers

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

---

Top Contributors

[![jaynilsavani](https://avatars.githubusercontent.com/u/76048534?v=4)](https://github.com/jaynilsavani "jaynilsavani (8 commits)")[![wankimmy](https://avatars.githubusercontent.com/u/34327646?v=4)](https://github.com/wankimmy "wankimmy (1 commits)")

---

Tags

citycontinentcountriescountrylaravellaravel-citieslaravel-countrieslaravel-country-state-city-seederlaravel-stateslaravel-uilocationphpstateworldphplaravelstatemaplocationcountrycityworld

### Embed Badge

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

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

###  Alternatives

[spatie/geocoder

Geocoding addresses to coordinates

8404.8M15](/packages/spatie-geocoder)[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)[dipeshsukhia/laravel-country-state-city-data

Country State City Data Provider

8230.8k](/packages/dipeshsukhia-laravel-country-state-city-data)[usamamuneerchaudhary/country-city-state

Country City State Data Provider for Laravel 12+

242.6k](/packages/usamamuneerchaudhary-country-city-state)[sun/country

Sun Country is the package that helps you to get the country name &amp; dialing code by the country ISO 3166-1 Alpha-2 code.

1016.5k](/packages/sun-country)[cuneytyuksel/turkey-cities

Turkey Cities and States - Türkiye İl ve İlçeler (PTT)

251.8k](/packages/cuneytyuksel-turkey-cities)

PHPackages © 2026

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