Download the PHP package jessebyarugaba/ug-address without Composer
On this page you can find all versions of the php package jessebyarugaba/ug-address. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ug-address
ug-address
A lightweight PHP SDK for cascading Uganda address selection.
Supports:
District → County/Division → Sub-county → Parish → Village
The SDK is:
- dependency-free
- offline-first
- framework agnostic
- fast
- pure PHP
Perfect for:
- Laravel
- Symfony
- CodeIgniter
- Slim
- custom PHP projects
- fintech onboarding
- delivery systems
- registration forms
- Uganda-based SaaS products
Installation
Install via Composer:
Quick Start
Example Output
Full Example
API Reference
Constructor
Data Getters
All getters return alphabetically sorted arrays.
getDistricts()
Returns all Uganda districts.
getCounties($districtId = null)
Returns counties/divisions for a district.
If no ID is provided, the currently selected district is used.
getSubcounties($countyId = null)
Returns sub-counties for a county.
getParishes($subcountyId = null)
Returns parishes for a sub-county.
getVillages($parishId = null)
Returns villages/cells for a parish.
Selection Methods
Selecting a level automatically clears downstream selections.
selectDistrict($id)
selectCounty($id)
selectSubcounty($id)
selectParish($id)
selectVillage($id)
Event Listeners
The SDK supports reactive callbacks.
onDistrictChange()
Event structure:
onCountyChange()
onSubcountyChange()
onParishChange()
onVillageChange()
Reading the Selection
getSelection()
Returns the currently selected hierarchy.
Example:
getFormattedAddress()
Returns a human-readable address string.
Example:
Direct Lookup Helpers
findDistrict()
findCounty()
findSubcounty()
findParish()
findVillage()
Reset
reset()
Clears all selected levels.
Laravel Example
Data Structure
Relationships:
Performance
The SDK ships with embedded Uganda administrative data:
- no API requests
- no database needed
- works fully offline
Use Cases
- Uganda registration forms
- Backend address validation
- Delivery systems
- CRM systems
- Fintech onboarding
- Logistics platforms
- Government systems
- Health systems
- E-commerce platforms
License
MIT License
Free for:
- commercial use
- SaaS products
- government systems
- educational projects
- open-source projects
Links
All versions of ug-address with dependencies
ext-json Version *