PHPackages                             aaqib/geo-pakistan - 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. [Database &amp; ORM](/categories/database)
4. /
5. aaqib/geo-pakistan

ActiveLibrary[Database &amp; ORM](/categories/database)

aaqib/geo-pakistan
==================

Provide Provinces, divisions, districts, Tehsils/Talukas and cities relations database for Pakistan.

1.0.0(5y ago)1322MITPHPPHP &gt;=7.1

Since Aug 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/aaqibmehran/geo-pakistan)[ Packagist](https://packagist.org/packages/aaqib/geo-pakistan)[ RSS](/packages/aaqib-geo-pakistan/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (2)Used By (0)

Laravel Geo Pakistan Database
=============================

[](#laravel-geo-pakistan-database)

This package focused on Provinces/States, Divisions, Districts and Tehsils/Talukas database of Pakistan for Laravel. Additionally, population, area and density, is also added according to census of 2017. Latitude and longitude of the region center is also added.

Conceptions
-----------

[](#conceptions)

There are 4 main objects in this package.

- Provinces/States: 7
- Divisions: 36
- Districts: 154
- Tehsils/talukas: 536

### Localization

[](#localization)

Right now, only English(default and fallback) is supported. We intend to add locale for urdu in the future updates.

Setup
-----

[](#setup)

- `composer require`

```
composer require aaqib/geo-pakistan
```

- Add Service Provider into `config/app.php`

```
'providers' => [
    // ...
    Aaqib\GeoPakistan\GeoPakistanServiceProvider::class,
]
```

- Publish and init

```
php artisan vendor:publish --force --provider="Aaqib\GeoPakistan\GeoPakistanServiceProvider"
composer dump-autoload
php artisan geopakistan:init
```

Usage
-----

[](#usage)

- get all Provinces

```
use Aaqib\GeoPakistan\Pakistan;

Pakistan::Provinces()
```

- get all Divisions

```
use Aaqib\GeoPakistan\Division;

Pakistan::Divisions()
```

- get divisions belong to a province

```
use Aaqib\GeoPakistan\Models\Province;

$punjab = Province::getByAbbr('PUN');
$divisions = $punjab->divisions()->get();
// or use children method
$divisions = $punjab->children();
```

- get province or parent

```
    $rawalpindi = Division::getByName('Rawalpindi');
    $punjab = $rawalpindi->parent();
```

- get parents of tehsil

```
// get district by tehsil
$lahore_city = Tehsil::getByName('Lahore City');
$Lahore = $lahore_city->district();

// get division by tehsil
$lahore_city = Tehsil::getByName('Lahore City');
$lahore = $lahore_city->division();

// get province by tehsil
$lahore_city = Tehsil::getByName('Lahore City');
$Punjab = $lahore_city->province();
```

- get tehsils by province and division

```
// get by province
$punjab = Province::getByAbbr('PUN');
$tehsils = $punjab->tehsils()->get();

// get by division
$rawalpindi = Division::getByName('Rawalpindi');
$tehsils = $rawalpindi->tehsils()->get();
```

About
-----

[](#about)

This package published under MIT license. If you have any question or suggestion, please feel free to submit an issue, or email me Aaqib Mehran .

Have a nice day.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

2142d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14160755?v=4)[Aaqib Mehran](/maintainers/aaqibmehran)[@aaqibmehran](https://github.com/aaqibmehran)

---

Top Contributors

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

---

Tags

databasedistrictsdivisionslaravelphpprovincesstatestalukastehsils

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aaqib-geo-pakistan/health.svg)

```
[![Health](https://phpackages.com/badges/aaqib-geo-pakistan/health.svg)](https://phpackages.com/packages/aaqib-geo-pakistan)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k3.5k](/packages/leantime-leantime)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3417.0k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

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