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

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

dougsisk/laravel-country-state
==============================

Country &amp; state helper for Laravel.

5.1(1mo ago)1681.7M—6.2%14MITPHPPHP ^8.2CI passing

Since Oct 2Pushed 1mo ago3 watchersCompare

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

READMEChangelog (10)Dependencies (8)Versions (28)Used By (0)

Laravel Country &amp; State Helper
==================================

[](#laravel-country--state-helper)

[![Latest Stable Version](https://camo.githubusercontent.com/1227d00b7f67d87c13d656c77ef9eedc309082ccec1914de000bfbc3da15bb52/68747470733a2f2f706f7365722e707567782e6f72672f646f75677369736b2f6c61726176656c2d636f756e7472792d73746174652f76657273696f6e)](https://packagist.org/packages/dougsisk/laravel-country-state)[![Total Downloads](https://camo.githubusercontent.com/c0294da9139805aa245f762d377a1b1ea2c1b54ed065dfa8d66543fbea706c96/68747470733a2f2f706f7365722e707567782e6f72672f646f75677369736b2f6c61726176656c2d636f756e7472792d73746174652f646f776e6c6f616473)](https://packagist.org/packages/dougsisk/laravel-country-state)[![License](https://camo.githubusercontent.com/75eb5404f83b7a9ad0d68736ae08545d90b87ded0a5a399e2fa747dff345f74f/68747470733a2f2f706f7365722e707567782e6f72672f646f75677369736b2f6c61726176656c2d636f756e7472792d73746174652f6c6963656e7365)](https://packagist.org/packages/dougsisk/laravel-country-state)

A helper to list countries &amp; states in English in **Laravel 11.0+**.

What's Changed in 5.0
---------------------

[](#whats-changed-in-50)

- **PHP 8.2+ required**

*I'm aware the underlying country/state data package I utilize has not been actively maintained. I've looked into other packages, but have yet to find one that can easily be swapped in. Please feel free to submit a PR if you find one you think is a suitable replacement.*

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

[](#installation)

Require this package with composer:

```
composer require dougsisk/laravel-country-state

```

This package will automatically be discovered by Laravel, if enabled. If you don't have auto package discovery on, you'll need to add the following service provider to your config/app.php:

```
DougSisk\CountryState\CountryStateServiceProvider::class,

```

Copy the package config to your local config with the publish command:

```
php artisan vendor:publish --provider="DougSisk\CountryState\CountryStateServiceProvider" --tag="config"

```

Configuration
-------------

[](#configuration)

By default, the helper will preload states for the US. You can change this via the `preloadCountryStates` config option:

```
'preloadCountryStates' => ['CA', 'MX', 'US']

```

If you don't want every country to be returned, you can define countries using the `limitCountries` config option:

```
'limitCountries' => ['CA', 'MX', 'US']

```

Usage
-----

[](#usage)

You may now use the `CountryState` facade to access countries and states.

**Remember to import the namespace to access the facade in your files:**

```
use CountryState;

```

To get an array of countries:

```
$countries = CountryState::getCountries();

```

The array keys will be the countries' 2 letter ISO code and the values will be the countries' English name. You may also set the 3 letter ISO key as the argument to receive translations of the countries' names (limited support).

To get an array of a country's states, simply pass the country's 2 letter ISO code:

```
$states = CountryState::getStates('US');

```

The array keys will be the states' 2 letter ISO code and the values will be the states' English name.

License
-------

[](#license)

This library is available under the [MIT license](LICENSE).

###  Health Score

67

—

FairBetter than 100% of packages

Maintenance88

Actively maintained with recent releases

Popularity57

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.2% 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 ~152 days

Recently: every ~286 days

Total

26

Last Release

59d ago

Major Versions

1.2.1 → 2.02017-02-03

2.1.1 → 3.02019-09-09

3.1 → 4.02020-12-28

4.3 → 5.02025-02-14

PHP version history (5 changes)1.0PHP &gt;=5.4.0

2.0PHP &gt;=7.0

3.0PHP ^7.2

4.0PHP ^7.4|^8.0

5.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f320f75fb12f31c48921ddaf1ccdc936d5487716e76a983a5949aadd90d52c9?d=identicon)[DougSisk](/maintainers/DougSisk)

---

Top Contributors

[![DougSisk](https://avatars.githubusercontent.com/u/70512?v=4)](https://github.com/DougSisk "DougSisk (51 commits)")[![jhornitzky](https://avatars.githubusercontent.com/u/655042?v=4)](https://github.com/jhornitzky "jhornitzky (1 commits)")[![tentus](https://avatars.githubusercontent.com/u/3709892?v=4)](https://github.com/tentus "tentus (1 commits)")

---

Tags

countriescountrylaravelphpstatestateslaravelcountriesstatecountrystates

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[dipeshsukhia/laravel-country-state-city-data

Country State City Data Provider

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

PHP Countries and Currencies

1.9k3.3M18](/packages/pragmarx-countries)[sebdesign/laravel-state-machine

Winzou State Machine service provider for Laravel

3401.3M1](/packages/sebdesign-laravel-state-machine)[usamamuneerchaudhary/country-city-state

Country City State Data Provider for Laravel 12+

242.6k](/packages/usamamuneerchaudhary-country-city-state)[pragmarx/countries-laravel

Countries for Laravel

1471.1M2](/packages/pragmarx-countries-laravel)[stidges/laravel-country-flags

A Laravel wrapper for the stidges/country-flags package

28134.6k](/packages/stidges-laravel-country-flags)

PHPackages © 2026

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