PHPackages                             gp10devhts/ug-village-locations - 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. gp10devhts/ug-village-locations

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

gp10devhts/ug-village-locations
===============================

village locations package for uganda

v1.0.6(3w ago)010↓88.9%1MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since May 28Pushed 3w agoCompare

[ Source](https://github.com/GP10DevHTS/ug-village-locations)[ Packagist](https://packagist.org/packages/gp10devhts/ug-village-locations)[ Docs](https://github.com/gp10devhts/ug-village-locations)[ RSS](/packages/gp10devhts-ug-village-locations/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (7)Dependencies (26)Versions (11)Used By (0)

Uganda Administrative Hierarchy Package
=======================================

[](#uganda-administrative-hierarchy-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/041c4f2654af137ba02803b0be0270ef388f63bfe452ffe5f5a6bf758d0fa093/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f677031306465766874732f75672d76696c6c6167652d6c6f636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gp10devhts/ug-village-locations)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ff58b788f51139a737c5d80abdda6a1127dab2861834e4ae120794ca5138cca5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f677031306465766874732f75672d76696c6c6167652d6c6f636174696f6e732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/gp10devhts/ug-village-locations/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b27cb187b444d5445d17ab66c00f82fbfae588296bb0f35765953d3bba19a8a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f677031306465766874732f75672d76696c6c6167652d6c6f636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gp10devhts/ug-village-locations)

A production-ready Laravel package that provides Uganda administrative locations from District → County → Sub County → Parish → Village.

Features
--------

[](#features)

- Full administrative hierarchy: Districts, Counties, Sub-Counties, Parishes, and Villages.
- Fast seeding via SQL dumps (offline support).
- Configurable hierarchy depth.
- Eloquent models and relationships.
- Name-based searching scopes.
- Maintainer tools for data collection from remote sources.
- Optional UUID support.

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

[](#installation)

You can install the package via composer:

```
composer require gp10devhts/ug-village-locations
```

Publish the config and migrations:

```
php artisan vendor:publish --tag="ug-village-locations-config"
php artisan vendor:publish --tag="ug-village-locations-migrations"
```

Run the migrations:

```
php artisan migrate
```

Seed the locations:

```
php artisan ug-locations:seed
```

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

[](#configuration)

You can customize the package via `config/ug-village-locations.php`:

```
return [
    'seed_levels' => [
        'districts',
        'counties',
        'sub_counties',
        'parishes',
        'villages',
    ],
    'use_uuids' => false,

    'models' => [
        'district' => \Gp10devhts\UgVillageLocations\Models\District::class,
        'county' => \Gp10devhts\UgVillageLocations\Models\County::class,
        'sub_county' => \Gp10devhts\UgVillageLocations\Models\SubCounty::class,
        'parish' => \Gp10devhts\UgVillageLocations\Models\Parish::class,
        'village' => \Gp10devhts\UgVillageLocations\Models\Village::class,
    ],
];
```

Usage
-----

[](#usage)

### Eloquent Models

[](#eloquent-models)

```
use Gp10devhts\UgVillageLocations\Models\District;
use Gp10devhts\UgVillageLocations\Models\Village;

// Get all districts
$districts = District::all();

// Search by name
$kampala = District::search('Kampala')->first();

// Relationships
$counties = $kampala->counties;
$villages = Village::where('name', 'like', '%Kibuli%')->with('parish.subCounty.county.district')->get();

// Using the Facade for model resolution and helper methods
use Gp10devhts\UgVillageLocations\Facades\UgVillageLocations;

$districtModel = UgVillageLocations::districtModel();
$districts = UgVillageLocations::districts();
$counties = UgVillageLocations::counties($districtId);
```

### Demo Project

[](#demo-project)

A demo Laravel project is available at [github.com/GP10DevHTS/ug-locations-demo](https://github.com/GP10DevHTS/ug-locations-demo).

#### **Notices:**

[](#notices)

- the project uses a custom District model to add regions.
- the model extention migrations use the default table names from the package.

### Model Extensibility

[](#model-extensibility)

You can override the default models by updating the `models` array in the config file. This allows you to add custom relationships, scopes, or traits.

```
// config/ug-village-locations.php
'models' => [
    'village' => App\Models\Village::class,
],
```

Your custom model should extend the package's base model:

```
namespace App\Models;

use Gp10devhts\UgVillageLocations\Models\Village as BaseVillage;

class Village extends BaseVillage
{
    // Custom logic
}
```

Artisan Commands
----------------

[](#artisan-commands)

- `php artisan ug-locations:seed`: Seed the database from local SQL dumps.
- `php artisan ug-locations:truncate`: Wipe all administrative location data.
- `php artisan ug-locations:fetch`: (Maintainer only) Fetch fresh data from remote source.
- `php artisan ug-locations:build-dump`: (Maintainer only) Generate SQL dumps from fetched data.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance95

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.9% 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 ~5 days

Total

7

Last Release

25d ago

PHP version history (2 changes)v1.0.0PHP ^8.3|^8.4

v1.0.6PHP ^8.2|^8.3|^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/157502147?v=4)[Ahairwe Jordan](/maintainers/gp10devhts)[@GP10DevHTS](https://github.com/GP10DevHTS)

---

Top Contributors

[![GP10DevHTS](https://avatars.githubusercontent.com/u/157502147?v=4)](https://github.com/GP10DevHTS "GP10DevHTS (34 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![LemiManoah](https://avatars.githubusercontent.com/u/82369659?v=4)](https://github.com/LemiManoah "LemiManoah (1 commits)")

---

Tags

laravelgp10devhtsug-village-locations

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/gp10devhts-ug-village-locations/health.svg)

```
[![Health](https://phpackages.com/badges/gp10devhts-ug-village-locations/health.svg)](https://phpackages.com/packages/gp10devhts-ug-village-locations)
```

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M48](/packages/spatie-laravel-pdf)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

330530.5k30](/packages/codewithdennis-filament-select-tree)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.8k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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