{"id":36427525,"url":"https://github.com/aaqibmehran/geo-pakistan","last_synced_at":"2026-01-11T18:05:47.174Z","repository":{"id":56939056,"uuid":"288754514","full_name":"aaqibmehran/geo-pakistan","owner":"aaqibmehran","description":"Provide provinces/states, divisions, districts and tehsils/talukas relations database for Pakistan.","archived":false,"fork":false,"pushed_at":"2020-08-23T21:11:07.000Z","size":371,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-17T15:52:04.097Z","etag":null,"topics":["database","districts","divisions","laravel","php","provinces","states","talukas","tehsils"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaqibmehran.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-19T14:29:39.000Z","updated_at":"2023-05-17T09:27:59.000Z","dependencies_parsed_at":"2022-08-21T06:50:12.636Z","dependency_job_id":null,"html_url":"https://github.com/aaqibmehran/geo-pakistan","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aaqibmehran/geo-pakistan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaqibmehran%2Fgeo-pakistan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaqibmehran%2Fgeo-pakistan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaqibmehran%2Fgeo-pakistan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaqibmehran%2Fgeo-pakistan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaqibmehran","download_url":"https://codeload.github.com/aaqibmehran/geo-pakistan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaqibmehran%2Fgeo-pakistan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28317500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","districts","divisions","laravel","php","provinces","states","talukas","tehsils"],"created_at":"2026-01-11T18:05:42.153Z","updated_at":"2026-01-11T18:05:47.162Z","avatar_url":"https://github.com/aaqibmehran.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Geo Pakistan Database\n\nThis package focused on Provinces/States, Divisions, Districts and Tehsils/Talukas database of Pakistan for Laravel.\nAdditionally, population, area and density, is also added according to census of 2017. Latitude and longitude of the region center is also added. \n\n## Conceptions\n\nThere are 4 main objects in this package.\n\n- Provinces/States: 7\n- Divisions: 36\n- Districts: 154\n- Tehsils/talukas: 536\n\n### Localization\n\nRight now, only English(default and fallback) is supported. We intend to add locale for urdu in the future updates.\n\n## Setup\n\n- `composer require`\n\n```php\ncomposer require aaqib/geo-pakistan\n```\n\n- Add Service Provider into `config/app.php`\n\n```php\n'providers' =\u003e [\n    // ...\n    Aaqib\\GeoPakistan\\GeoPakistanServiceProvider::class,\n]\n```\n\n- Publish and init\n\n```php\nphp artisan vendor:publish --force --provider=\"Aaqib\\GeoPakistan\\GeoPakistanServiceProvider\"\ncomposer dump-autoload\nphp artisan geopakistan:init\n```\n\n## Usage\n\n- get all Provinces\n\n```php\nuse Aaqib\\GeoPakistan\\Pakistan;\n\nPakistan::Provinces()\n\n```\n\n- get all Divisions\n\n```php\nuse Aaqib\\GeoPakistan\\Division;\n\nPakistan::Divisions()\n```\n\n- get divisions belong to a province\n\n```php\nuse Aaqib\\GeoPakistan\\Models\\Province;\n\n$punjab = Province::getByAbbr('PUN');\n$divisions = $punjab-\u003edivisions()-\u003eget();\n// or use children method\n$divisions = $punjab-\u003echildren();\n```\n\n- get province or parent\n```php\n    $rawalpindi = Division::getByName('Rawalpindi');\n    $punjab = $rawalpindi-\u003eparent();\n```\n\n- get parents of tehsil\n\n```php\n// get district by tehsil\n$lahore_city = Tehsil::getByName('Lahore City');\n$Lahore = $lahore_city-\u003edistrict();\n\n// get division by tehsil\n$lahore_city = Tehsil::getByName('Lahore City');\n$lahore = $lahore_city-\u003edivision();\n\n// get province by tehsil\n$lahore_city = Tehsil::getByName('Lahore City');\n$Punjab = $lahore_city-\u003eprovince();\n```\n\n- get tehsils by province and division\n\n```php\n// get by province\n$punjab = Province::getByAbbr('PUN');\n$tehsils = $punjab-\u003etehsils()-\u003eget();\n\n// get by division\n$rawalpindi = Division::getByName('Rawalpindi');\n$tehsils = $rawalpindi-\u003etehsils()-\u003eget();\n```\n\n## About\n\nThis package published under MIT license. If you have any question or suggestion, please feel free to submit an issue, or email me Aaqib Mehran \u003cmehran.aaqib@gmail.com\u003e.\n\nHave a nice day.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaqibmehran%2Fgeo-pakistan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaqibmehran%2Fgeo-pakistan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaqibmehran%2Fgeo-pakistan/lists"}