PHPackages                             adrianmejias/laravel-states - 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. adrianmejias/laravel-states

AbandonedArchivedLaravel-library[Utility &amp; Helpers](/categories/utility)

adrianmejias/laravel-states
===========================

Laravel States is a bundle for Laravel, providing abbreviation, name and country code for US states.

v1.2.5(4y ago)13301.4k↓29%7MITPHPPHP &gt;=5.3.0

Since Apr 3Pushed 4y ago1 watchersCompare

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

READMEChangelog (9)DependenciesVersions (10)Used By (0)

Laravel States
==============

[](#laravel-states)

Laravel States is a bundle for Laravel, providing abbreviation, name and country code for US states.

Currently, I only have US states but additional states from other countries could be added using the country code column.

**Please not that this is for Laravel 5 only.**

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

[](#installation)

Add `adrianmejias/laravel-states` to `composer.json`.

```
"adrianmejias/laravel-states": "~1.0"

```

Run `composer update` to pull down the latest version of Country List.

Edit `app/config/app.php` and add the `provider` and `filter`

```
'providers' => [
    AdrianMejias\States\StatesServiceProvider::class,
]

```

Now add the alias.

```
'aliases' => [
    'States' => AdrianMejias\States\StatesFacade::class,
]

```

Model
-----

[](#model)

You can start by publishing the configuration. This is an optional step, it contains the table name and does not need to be altered. If the default name `states` suits you, leave it. Otherwise run the following command

```
$ php artisan vendor:publish

```

Next generate the migration file:

```
$ php artisan states:migration
$ composer dump-autoload

```

It will generate the `_setup_states_table.php` migration and the `StatesSeeder.php` seeder. To make sure the data is seeded insert the following code in the `database/seeds/DatabaseSeeder.php`

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

```

You may now run it with the artisan migrate command:

```
$ php artisan migrate --seed

```

After running this command the filled states table will be available.

Example
-------

[](#example)

Example blade formatting:

```
@foreach(States::whereCountryCode('US')->get() as $state)
    {{ $state->name }} {{ $state->country_code }}
@endforeach

```

Should result in:

```
Alabama US
Arkansas US
Arizona US
...

```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 77.4% 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 ~332 days

Recently: every ~499 days

Total

8

Last Release

1738d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/70bc994aa5551eb623dafac5074a508e33176eba575962e63039b7106b3ccd56?d=identicon)[adrianmejias](/maintainers/adrianmejias)

---

Top Contributors

[![adrianmejias](https://avatars.githubusercontent.com/u/1440288?v=4)](https://github.com/adrianmejias "adrianmejias (24 commits)")[![MCMatters](https://avatars.githubusercontent.com/u/3148853?v=4)](https://github.com/MCMatters "MCMatters (2 commits)")[![jsimon5](https://avatars.githubusercontent.com/u/42071981?v=4)](https://github.com/jsimon5 "jsimon5 (1 commits)")[![theCowBoiCoder](https://avatars.githubusercontent.com/u/2730493?v=4)](https://github.com/theCowBoiCoder "theCowBoiCoder (1 commits)")[![Xerotherm1c](https://avatars.githubusercontent.com/u/33434378?v=4)](https://github.com/Xerotherm1c "Xerotherm1c (1 commits)")[![karmon](https://avatars.githubusercontent.com/u/4479707?v=4)](https://github.com/karmon "karmon (1 commits)")[![chrisdicarlo](https://avatars.githubusercontent.com/u/3483368?v=4)](https://github.com/chrisdicarlo "chrisdicarlo (1 commits)")

---

Tags

laravelstatesunited-statesus statesusa

### Embed Badge

![Health badge](/badges/adrianmejias-laravel-states/health.svg)

```
[![Health](https://phpackages.com/badges/adrianmejias-laravel-states/health.svg)](https://phpackages.com/packages/adrianmejias-laravel-states)
```

###  Alternatives

[pragmarx/countries

PHP Countries and Currencies

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

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)[pragmarx/countries-laravel

Countries for Laravel

1471.1M2](/packages/pragmarx-countries-laravel)[dipeshsukhia/laravel-country-state-city-data

Country State City Data Provider

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

A PHP Finite State Machine for Laravel 5+

302.0k](/packages/daveawb-understated)[usamamuneerchaudhary/country-city-state

Country City State Data Provider for Laravel 12+

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

PHPackages © 2026

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