PHPackages                             mark-villudo/countries-states-cities - 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. mark-villudo/countries-states-cities

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

mark-villudo/countries-states-cities
====================================

Laravel package for Countries, State / Province, and Cities

2731PHP

Since Jan 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/MarkVilludo/countries-states-cities)[ Packagist](https://packagist.org/packages/mark-villudo/countries-states-cities)[ RSS](/packages/mark-villudo-countries-states-cities/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

countries-states-cities
=======================

[](#countries-states-cities)

Laravel package for addresses that mostly used for dropdown in form.

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

[](#installation)

1. Require this package with composer.

```
composer require mark-villudo/countries-states-cities
```

2. Now add the service provider in config/app.php file:

```
'providers' => [
    // ...
    MarkVilludo\CountryStateCities\ServiceProvider::class,
];

```

3. Publish Seeder and Migration files

You can publish the migration with:

```

php artisan vendor:publish --provider="MarkVilludo\CountryStateCities\ServiceProvider" --tag="migrations"

```

Then, run

```

php artisan migrate

```

You can publish the seeder with:

```

php artisan vendor:publish --provider="MarkVilludo\CountryStateCities\ServiceProvider" --tag="seeder"

```

Declare published seeder in DatabaseSeeder.php

```
public function run()
{
  $this->call(CountryTableSeeder::class);
  $this->call(ProvincesTableSeeder::class);
  $this->call(CitiesTableSeeder::class);
}

```

Then, run

```

php artisan db:seed

```

You can publish its default controllers

```

php artisan vendor:publish --provider="MarkVilludo\CountryStateCities\ServiceProvider" --tag="controllers"

```

4. Make resource file for models. for Countries, Provinces, and Cities.

```
php artisan make:resource CountryResource
php artisan make:resource ProvinceResource
php artisan make:resource CityResource

```

```
php artisan make:model Models/Country
php artisan make:model Models/Province
php artisan make:model Models/City

```

5. Add this route in routes/api.php

```

Route::prefix('v1')->group(function () {
  //Country, Province/State and City
  Route::prefix('countries')->group(function () {
    Route::get('/','Api\CountryController@index');
    Route::get('/{id}/provinces','Api\ProvinceController@index');
  });
  Route::prefix('provinces')->group(function () {
    Route::get('/{id}/cities','Api\CityController@index');
  });
});

```

Usage
-----

[](#usage)

//Serve app. `php artisan serve`

//Access the url from the code added in routes/api.php

```
http://127.0.0.1:8000/api/v1/countries
http://127.0.0.1:8000/api/v1/countries/169/provinces
http://127.0.0.1:8000/api/v1/provinces/46/cities

```

License
-------

[](#license)

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

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc1f7cec431adffc9b18bb57feee89c5955317e8369c82e3cbf2b786dacb225f?d=identicon)[Mark Villudo](/maintainers/Mark%20Villudo)

---

Top Contributors

[![MarkVilludo](https://avatars.githubusercontent.com/u/16302633?v=4)](https://github.com/MarkVilludo "MarkVilludo (26 commits)")

### Embed Badge

![Health badge](/badges/mark-villudo-countries-states-cities/health.svg)

```
[![Health](https://phpackages.com/badges/mark-villudo-countries-states-cities/health.svg)](https://phpackages.com/packages/mark-villudo-countries-states-cities)
```

###  Alternatives

[mautic/mautic-typo3

Add-on TYPO3 extension that enhances the "EXT:marketing\_automation" TYPO3 extension by connecting it to the Mautic Marketing Automation platform: Determine "Persona" from Mautic segments. Also provides additional services e.g. language synchronisation between Mautic and TYPO3.

236.3k](/packages/mautic-mautic-typo3)

PHPackages © 2026

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