PHPackages                             sidm/laravel-subdivisions - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. sidm/laravel-subdivisions

ActiveLaravel-library[Localization &amp; i18n](/categories/localization)

sidm/laravel-subdivisions
=========================

Laravel Subdivisions is a bundle for Laravel 4.2, providing what is roughly all ISO 3166\_2 subdivisions (a.k.a., states, provinces, etc.) for all countries. Based on the awesome work Webpatser did in his laravel-countries package.

v1.0.2(10y ago)44923[1 issues](https://github.com/sidm/laravel-subdivisions/issues)MITPHPPHP &gt;=5.3.0

Since Apr 2Pushed 10y ago1 watchersCompare

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

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

Laravel Subdivisions
====================

[](#laravel-subdivisions)

[![Total Downloads](https://camo.githubusercontent.com/df7e537df250efee4240ce9745d51e62afde9c071c4324067b3cfa7f6d843b2c/68747470733a2f2f706f7365722e707567782e6f72672f7369646d2f6c61726176656c2d7375626469766973696f6e732f646f776e6c6f6164732e737667)](https://packagist.org/packages/sidm/laravel-subdivisions)[![Latest Stable Version](https://camo.githubusercontent.com/9d63bee789fa06ef38607a342e16caef304154f8e2bcc2a3d07735f517adf27e/68747470733a2f2f706f7365722e707567782e6f72672f7369646d2f6c61726176656c2d7375626469766973696f6e732f762f737461626c652e737667)](https://packagist.org/packages/sidm/laravel-subdivisions)[![Latest Unstable Version](https://camo.githubusercontent.com/29c3b4eb339e405b42a0193ff9d2040cc3aff656223d0aae887fb118781b2279/68747470733a2f2f706f7365722e707567782e6f72672f7369646d2f6c61726176656c2d7375626469766973696f6e732f762f756e737461626c652e737667)](https://packagist.org/packages/sidm/laravel-subdivisions)[![License](https://camo.githubusercontent.com/8ad9c61d83355d78cb94f0940d751f9620fc8e1b93d416ec76599af637a845d0/68747470733a2f2f706f7365722e707567782e6f72672f7369646d2f6c61726176656c2d7375626469766973696f6e732f6c6963656e73652e737667)](https://packagist.org/packages/sidm/laravel-subdivisions)

Laravel Subdivisions is a bundle for Laravel 4.2, providing what is roughly all ISO 3166\_2 subdivisions (a.k.a., states, provinces, etc.) for all countries. Based on the awesome work Webpatser did in his laravel-countries package.

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

[](#installation)

Add `sidm/laravel-subdivisions` to `composer.json`.

```
"sidm/laravel-subdivisions": "dev-master"

```

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

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

```
'providers' => array(
    'sidm\Subdivisions\SubdivisionsServiceProvider',
)

```

Now add the alias.

```
'aliases' => array(
    'Subdivisions' => 'sidm\Subdivisions\SubdivisionsFacade',
)

```

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

[](#configuration)

Start by publishing the configuration. The first variable is the table name, if the default name `subdivisions` is fine you should not modify it.

The next two variables are very important:

```
'country_table_name' => 'countries',
'iso_3166_2_column_name' => 'iso_3166_2',

```

If you only want subdivisions and do not have a countries table both of these values should be changed to null (i.e., ''). If you are using the Webpatser/laravel-countries package the defaults should work fine. If you are using another package, or have rolled your own, the `country_table_name` should be set to the table name that holds your list of countries, and `iso_3166_2_column_name` should be set to the name of the column that contains the iso\_3166\_2 values for each country.

When you have modified the configuration file (src/config/config.php) run the following command:

```
$ php artisan config:publish sidm/laravel-subdivisions

```

Model
-----

[](#model)

Next generate the migration file:

```
$ php artisan subdivisions:migration

```

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

```
//Seed the subdivisions
$this->call('SubdivisionsSeeder');
$this->command->info('Seeded the subdivisions!');

```

You may now run it with the artisan migrate command:

```
$ php artisan migrate --seed

```

After running this command the filled subdivisions table will be available

Example
-------

[](#example)

If you are using the Webpatser/laravel-countries package to use this in a form you can place the following in any controller:

```
$countries = Countries::lists('name', 'id');
$states = Subdivisions::where('country_id', '=', 840)->lists('region', 'id');
return View::make('yourview.create', compact('countries', 'states'));

```

Then in a form to use countries you may do the following:

```
{{ Form::label('country', 'Country') }}
// 840 will default to the United States
{{ Form::select('country', $countries, '840') }}

```

Finally for states you may do the following:

```
{{ Form::label('state', 'State/Province/Region') }}
// 4133 will default to Alabama
{{ Form::select('state', $states, '4133') }}

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 95.7% 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 ~45 days

Total

3

Last Release

3974d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39689cd8668f60620318ec2ca34ed097f68d7e399af0bb9210e4c4d15c4b4f2e?d=identicon)[sidm](/maintainers/sidm)

---

Top Contributors

[![sidm](https://avatars.githubusercontent.com/u/728604?v=4)](https://github.com/sidm "sidm (22 commits)")[![kitbs](https://avatars.githubusercontent.com/u/4569320?v=4)](https://github.com/kitbs "kitbs (1 commits)")

---

Tags

laravelcountriesstatesiso\_3166\_2subdivisions

### Embed Badge

![Health badge](/badges/sidm-laravel-subdivisions/health.svg)

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

###  Alternatives

[nnjeim/world

Laravel countries, states, cities, currencies, languages and IP geolocation

970361.2k3](/packages/nnjeim-world)[monarobase/country-list

List of all countries with names and ISO 3166-1 codes in all languages and data formats for Laravel

2672.7M7](/packages/monarobase-country-list)[dougsisk/laravel-country-state

Country &amp; state helper for Laravel.

1681.7M](/packages/dougsisk-laravel-country-state)[pharaonic/laravel-locations

Laravel - Countries\[States/Cities, Currency, Phone Code, Languages, Capital\] &amp; Continents &amp; Timezones.

102.4k1](/packages/pharaonic-laravel-locations)

PHPackages © 2026

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