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)62975MITPHP

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 4w 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

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

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

3546d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66728366?v=4)[badebiyi](/maintainers/badebiyi)[@badebiyi](https://github.com/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.8k54.1M11.2k](/packages/illuminate-database)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k29.9M42](/packages/kirschbaum-development-eloquent-power-joins)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8723.1M23](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.4M2](/packages/glushkovds-phpclickhouse-laravel)[lemaur/eloquent-publishing

207.8k1](/packages/lemaur-eloquent-publishing)[laravel-liberu/laravel-gedcom

A package that converts gedcom files to Eloquent models

782.5k1](/packages/laravel-liberu-laravel-gedcom)

PHPackages © 2026

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