salimmbise/tanzania-regions

A Laravel package to get Tanzanian regions and their districts

Installs: 156

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 2

Open Issues: 0

pkg:composer/salimmbise/tanzania-regions

v2.0.0 2024-06-07 06:41 UTC

This package is auto-updated.

Last update: 2025-10-21 09:52:30 UTC


README

How to Install the Package

composer require salimmbise/tanzania-regions

How to Use it

At first make sure you run composer require and publish the Vendor, then import this package in order to use it:

use SalimMbise\TanzaniaRegions\TanzaniaRegions; 

Get All Regions

$tanzaniaRegions = new TanzaniaRegions();
$regions = $tanzaniaRegions->getRegions();

Get All Regions, Districts and Wards (with Postcode)

$regions = new TanzaniaRegions();
$allRegionsData = $regions->getAllData();

Get All Districts

$tanzaniaRegions = new TanzaniaRegions();
$districts = $tanzaniaRegions->getDistricts();

Get All Regions with their Districts

$tanzaniaRegions = new TanzaniaRegions();
$regions = $tanzaniaRegions->getRegions();

$regionsWithDistricts = [];

foreach ($regions as $region) {
$districts = $tanzaniaRegions->getDistricts($region);
$regionsWithDistricts[$region] = $districts;

}

Happy Coding!