PHPackages                             wapnen/ghregionsdistrict - 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. wapnen/ghregionsdistrict

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

wapnen/ghregionsdistrict
========================

Laravel package to get Ghana's regions and districts

163PHP

Since Mar 3Pushed 8y ago1 watchersCompare

[ Source](https://github.com/wapnen/GhRegionsDistrict)[ Packagist](https://packagist.org/packages/wapnen/ghregionsdistrict)[ RSS](/packages/wapnen-ghregionsdistrict/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

GhRegionsDistrict
-----------------

[](#ghregionsdistrict)

Laravel package for retreiving Ghana's regions and districts

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

[](#installation)

[PHP](https://php.net) 5.4+ and [Composer](https://getcomposer.org) are required.

To get the latest version of this package add the following block of code to the require block of your project's composer.json

```
"wapnen/GHRegionsDistrict": "1.0.*"

```

You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated.

Once GhRegionsDistrict is installed, you need to register the service provider. Open up `config/app.php` and add the following to the `providers` key.

- `Wapnen\GhRegionDistrict\GhRegionDistrictServiceProvider::class,`

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

[](#configuration)

To start using this package, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish --provider="Wapnen\GhRegionDistrict\GhRegionDistrictServiceProvider"
```

Now migrate your database to include the regions and districts tables

```
$ php artisan migrate
```

Add the following to your application's Databaseseeder.php file

```
        $this->call(RegionTableSeeder::class);
        $this->call(District1TableSeeder::class);
        $this->call(District2TableSeeder::class);
        $this->call(District3TableSeeder::class);
        $this->call(District4TableSeeder::class);
        $this->call(District5TableSeeder::class);
        $this->call(District6TableSeeder::class);
        $this->call(District7TableSeeder::class);
        $this->call(District8TableSeeder::class);
        $this->call(District9TableSeeder::class);
        $this->call(District10TableSeeder::class);

```

run the following command to Autoload your files

```
composer dump-autoload

```

Finally run the following command to seed to your database

```
$ php artisan db:seed
```

Usage
-----

[](#usage)

To retrieve all the regions

```
$regions = DB::table('regions')->get();

```

To retrieve one region

```
$region = DB::table('regions')->where('name', 'Ashanti)->first();

```

To get all the districts for a particular region

```
$region = DB::table('regions')->where('name', 'Ashanti)->first();
$districts = DB::table('districts)->where('region_id' , $region->id)->get();

```

Contributing
------------

[](#contributing)

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

Want to link up?
----------------

[](#want-to-link-up)

You can [follow me on twitter](https://twitter.com/_wapnen)!

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/093f85d2bd85acaca769c9807e98e86c5fdfc64d424a8b020586589c1a788bf0?d=identicon)[wapnen](/maintainers/wapnen)

---

Top Contributors

[![wapnen](https://avatars.githubusercontent.com/u/18328614?v=4)](https://github.com/wapnen "wapnen (4 commits)")

### Embed Badge

![Health badge](/badges/wapnen-ghregionsdistrict/health.svg)

```
[![Health](https://phpackages.com/badges/wapnen-ghregionsdistrict/health.svg)](https://phpackages.com/packages/wapnen-ghregionsdistrict)
```

PHPackages © 2026

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