PHPackages                             bodunde/states-and-local-govt - 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. [Database &amp; ORM](/categories/database)
4. /
5. bodunde/states-and-local-govt

ActiveLibrary[Database &amp; ORM](/categories/database)

bodunde/states-and-local-govt
=============================

Populates your DB with all the states in Nigeria and their local governments. It also creates the models for you

v1.0(9y ago)6297↓100%5MITPHP

Since Oct 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/andela-badebiyi/Laravel-Nig-States-LocalGovt)[ Packagist](https://packagist.org/packages/bodunde/states-and-local-govt)[ RSS](/packages/bodunde-states-and-local-govt/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel-Nig-States-LocalGovt
============================

[](#laravel-nig-states-localgovt)

A Laravel Package that populates your database with all the states in the Nigeria and their corresponding local governments.

Setup
-----

[](#setup)

- Include package in your project by running `composer require bodunde/states-and-local-govt`
- Add `Bodunde\SLG\SLGServiceProvider::class` to provider in `app.php` under `config` directory
- Publish package resources by running `php artisan vendor:publish`. Running this command would publish models, migrations and seeders.
- Run published migrations `php artisan migrate`
- Regenerate your autoload files `composer dump-autoload`
- Run published database seeders `php artisan db:seed --class=SlgTableSeeder`

Usage
-----

[](#usage)

- Import models into your controllers

**Note: If your root namespace in your application isn't `app` make sure you go to the models and modify the namespace**

```
...
use App\State;
use App\LocalGovt;

...
...
// fetch all states
$states = State::all();

// fetch state by id
$state = State::find($id) // where $id = 1

// fetch state by name
$state = State::findByName("Lagos State");

//get state local governments
$lg = $state->localGovernments;

// get all local governments
$lgs = LocalGovt::all();

// fetch local government by id
$lg = LocalGovt::find($id) // where $id = 1

// fetch local government state
$state = $lg->state;
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 91.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

Unknown

Total

1

Last Release

3498d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4788fa54147cc95c210c54ba74e295fb57f230215eb15601e34a28d6f195678?d=identicon)[badebiyi](/maintainers/badebiyi)

---

Top Contributors

[![bodunadebiyi](https://avatars.githubusercontent.com/u/16083774?v=4)](https://github.com/bodunadebiyi "bodunadebiyi (11 commits)")[![raphyabak](https://avatars.githubusercontent.com/u/58911706?v=4)](https://github.com/raphyabak "raphyabak (1 commits)")

### Embed Badge

![Health badge](/badges/bodunde-states-and-local-govt/health.svg)

```
[![Health](https://phpackages.com/badges/bodunde-states-and-local-govt/health.svg)](https://phpackages.com/packages/bodunde-states-and-local-govt)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[cviebrock/eloquent-taggable

Easy ability to tag your Eloquent models in Laravel.

567694.8k3](/packages/cviebrock-eloquent-taggable)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[genealabs/laravel-pivot-events

This package introduces new eloquent events for sync(), attach(), detach() or updateExistingPivot() methods on BelongsToMany relation.

1404.9M8](/packages/genealabs-laravel-pivot-events)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)

PHPackages © 2026

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