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

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

elsayed85/laravel-country-state-city
====================================

Laravel country, state and city collection.

121PHP

Since Jun 3Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

[![Total Downloads](https://camo.githubusercontent.com/d31bb16758cc5c085afac62b3206fb8dc5c17121acf17405a92e1bbe6fd847ae/687474703a2f2f706f7365722e707567782e6f72672f6a61796e696c736176616e692f6c61726176656c2d636f756e7472792d73746174652d636974792f646f776e6c6f616473)](https://packagist.org/packages/jaynilsavani/laravel-country-state-city) [![License](https://camo.githubusercontent.com/fb1c9c4484feb040902dc1285c025c956128f6ca50d9bc281707b8087cb3d9aa/687474703a2f2f706f7365722e707567782e6f72672f6a61796e696c736176616e692f6c61726176656c2d636f756e7472792d73746174652d636974792f6c6963656e7365)](https://packagist.org/packages/jaynilsavani/laravel-country-state-city)

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

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 77.8% 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/9f6465ef2e90074d5a323bf893bb1ab9a7b5af7bf61d1001f85a8448d8fb257d?d=identicon)[elsayed851999](/maintainers/elsayed851999)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[rangerz/magento2-module-quicklink

Faster subsequent page-loads by prefetching in-viewport links during idle time.

3410.0k](/packages/rangerz-magento2-module-quicklink)[aozisik/php-turkce

Turkish language friendly string manipulation functions for PHP.

292.1k](/packages/aozisik-php-turkce)[zenstruck/class-metadata

Add human readable class aliases &amp; metadata with efficient lookups.

142.8k5](/packages/zenstruck-class-metadata)

PHPackages © 2026

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