PHPackages                             intanode/ug-locale - 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. intanode/ug-locale

ActiveLibrary[Localization &amp; i18n](/categories/localization)

intanode/ug-locale
==================

A package that provides a comprehensive set of resources to manage Ugandan location data (regions, districts, counties, sub-counties, parishes, and villages). This package includes configuration options, database migrations, and routes for a fully featured locale management system.

v1.2.4(1y ago)111MITPHPPHP ^8.1|^8.2

Since Feb 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/EmmanuelObua/ug-locale)[ Packagist](https://packagist.org/packages/intanode/ug-locale)[ RSS](/packages/intanode-ug-locale/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (9)Used By (0)

UG Locale
=========

[](#ug-locale)

**UG Locale** is a Laravel package that provides a comprehensive set of resources to manage Ugandan location data (regions, districts, counties, sub-counties, parishes, and villages). This package includes configuration options, database migrations, and routes for a fully featured locale management system.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Publishing Package Assets](#publishing-package-assets)
    - [Configuration](#configuration-file)
    - [Migrations](#migrations)
    - [Routes](#routes)
- [Usage](#usage)
    - [Adding the Routes to Your Application](#adding-the-routes-to-your-application)
    - [Installing Location Data](#installing-location-data)
- [Routes Overview](#routes-overview)
- [Additional Documentation](#additional-documentation)
- [License](#license)

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

[](#installation)

Install the package via Composer:

```
composer require intanode/ug-locale
```

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

[](#configuration)

After installing the package, you need to publish the configuration file. This file allows you to adjust various settings, such as the batch size for seeding records. The default value works perfectly for most applications, but you can modify it to suit your needs.

Publishing Package Assets
-------------------------

[](#publishing-package-assets)

Configuration File
------------------

[](#configuration-file)

Run the following Artisan command to publish the configuration file:

```
php artisan vendor:publish --tag=ug-locale-config
```

Once published, you can find the configuration file (typically config/ugLocale.php). Open it to adjust the batch size for seeding the location records if necessary.

Publishing Other Assets
-----------------------

[](#publishing-other-assets)

The package provides several assets that you need to publish into your Laravel application. Use the following commands:

Migrations
----------

[](#migrations)

Publish the migration files that create the necessary tables for the location data:

```
php artisan vendor:publish --tag=ug-locale-migrations
```

Routes
------

[](#routes)

Publish the routes file that gives you access to the locale resources:

```
php artisan vendor:publish --tag=ug-locale-routes
```

After publishing, the routes file (e.g., ugLocaleRoutes.php) will be available in your project. Usage

Adding the Routes to Your Application
-------------------------------------

[](#adding-the-routes-to-your-application)

To make the published routes available, you must include the routes file in your application's routes. Open your web.php file (usually located in the routes folder) and add the following line at the bottom:

```
require __DIR__.'/ugLocaleRoutes.php';
```

Installing Location Data
------------------------

[](#installing-location-data)

After you have published the migrations and configuration, run the following command to migrate and seed the location tables:

```
php artisan locale:install
```

This command will execute the migrations and populate the tables with the location data.

Routes Overview
---------------

[](#routes-overview)

Once installed, the package provides the following routes to interact with the locale resources:

GET Routes

```
GET /ug-locale/regions
Returns all regions.

GET /ug-locale/districts?region_id={region_id}
Returns all districts within a specified region.

GET /ug-locale/counties?district_id={district_id}
Returns all counties within a specified district.

GET /ug-locale/sub-counties?county_id={county_id}
Returns all sub-counties within a specified county.

GET /ug-locale/parishes?sub_county_id={sub_county_id}
Returns all parishes within a specified sub-county.

GET /ug-locale/villages?parish_id={parish_id}
Returns all villages within a specified parish.

```

POST Routes

```
POST /ug-locale/regions
Creates a new region if it does not exist.
Payload: { "name": "Region Name" }

POST /ug-locale/districts
Creates a new district if it does not exist.
Payload: { "name": "District Name", "region_id": 1 }

POST /ug-locale/counties
Creates a new county if it does not exist.
Payload: { "name": "County Name", "district_id": 1 }

POST /ug-locale/sub-counties
Creates a new sub-county if it does not exist.
Payload: { "name": "Sub-County Name", "county_id": 1 }

POST /ug-locale/parishes
Creates a new parish if it does not exist.
Payload: { "name": "Parish Name", "sub_county_id": 1 }

POST /ug-locale/villages
Creates a new village if it does not exist.
Payload: { "name": "Village Name", "parish_id": 1 }

```

Additional Documentation
------------------------

[](#additional-documentation)

For more detailed information about each component of the package, please refer to the following sections:

Configuration Options:
======================

[](#configuration-options)

Check out the config/ugLocale.php file for available settings, including the batch size for seeding.

Database Migrations:
====================

[](#database-migrations)

Review the migration files published under your migrations directory for the table schema details.

Controllers and Routes:
=======================

[](#controllers-and-routes)

The LocationController contains the logic for handling requests. The routes file (ugLocaleRoutes.php) documents the available endpoints.

Commands:
=========

[](#commands)

The Artisan command locale:install will automatically run your migrations and seed the database with initial location data.

License
=======

[](#license)

This package is open-sourced software licensed under the MIT license.

With these instructions, your Laravel application is now ready to manage Ugandan location data using the UG Locale package. Enjoy seamless integration and extended locale functionality!

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance42

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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.

###  Release Activity

Cadence

Every ~1 days

Total

7

Last Release

461d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/intanode-ug-locale/health.svg)

```
[![Health](https://phpackages.com/badges/intanode-ug-locale/health.svg)](https://phpackages.com/packages/intanode-ug-locale)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[stevebauman/translation

An easy automatic database driven translator for Laravel 5

7620.1k](/packages/stevebauman-translation)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5514.4k1](/packages/longman-laravel-multilang)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)

PHPackages © 2026

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