PHPackages                             open-afghanistan/provinces - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. open-afghanistan/provinces

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

open-afghanistan/provinces
==========================

Afghanistan provinces laravel package

1.0.3(7mo ago)101.1k↓76.2%4[1 issues](https://github.com/OpenAfghanistan/provinces/issues)MITPHPPHP &gt;=8.1

Since Sep 19Pushed 7mo agoCompare

[ Source](https://github.com/OpenAfghanistan/provinces)[ Packagist](https://packagist.org/packages/open-afghanistan/provinces)[ RSS](/packages/open-afghanistan-provinces/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (14)Used By (0)

Laravel Package: Afghanistan Provinces &amp; Districts
======================================================

[](#laravel-package-afghanistan-provinces--districts)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6c4fa71a30de6d5a79f68b2adf4bf0de6b9e8a36167cd36840ff96ac6269130d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f70656e2d61666768616e697374616e2f70726f76696e6365732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/open-afghanistan/provinces)[![Total Downloads](https://camo.githubusercontent.com/5d1d995a1cf5479c2e05682adb8c267cac9b326d067c54152bdfc6055aa73afd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f70656e2d61666768616e697374616e2f70726f76696e6365733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/open-afghanistan/provinces)[![Repo Size](https://camo.githubusercontent.com/fa24f029bf85ad4d3d20caaeceb3069ebe261c2d29e7355f0c00022d3b0e3386/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f4f70656e41666768616e697374616e2f70726f76696e6365733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/open-afghanistan/provinces)[![Repo Size](https://camo.githubusercontent.com/b82e285dcda39285aa591fba1b680da577977bf4be142a79b52d39d3ae00e2b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f70656e2d61666768616e697374616e2f70726f76696e6365733f7374796c653d666c61742d737175617265)](https://packagist.org/packages/open-afghanistan/provinces)

**Introduction:**

The Laravel package "provinces" provides essential resources for managing Afghanistan's provinces and districts within your Laravel application. This package includes models, migrations, seeders, and factories to facilitate the integration of Afghanistan's administrative divisions into your project.

**Requirements:**

To use this package, ensure your Laravel application meets the following requirements:

- PHP 8.1 or higher
- Laravel 9 or higher

**Installation:**

You can effortlessly install the "provinces" package using Composer. Open your terminal and run the following command:

```
composer require open-afghanistan/provinces
```

**Migrations:**

After successful installation, you need to publish the migration files. Use the following Artisan command:

```
php artisan vendor:publish --tag=provinces-migration
```

This command will generate a migration file that sets up the necessary tables for provinces and districts in your database.

**Seeders:**

The package includes a handy `ProvincesSeeder` that populates all 34 Afghanistan provinces along with their respective districts. You can call this seeder in your project's database seeder file as follows:

```
// DatabaseSeeder.php

use OpenAfghanistan\Provinces\Database\Seeders\ProvincesSeeder;

$this->call(ProvincesSeeder::class);
```

If you only wish to seed specific provinces, you can call their individual seeder classes:

```
// DatabaseSeeder.php

use OpenAfghanistan\Provinces\Database\Seeders\KabulProvinceSeeder;

$this->call(KabulProvinceSeeder::class);
```

**Factories:**

To facilitate testing, this package provides factories for both provinces and districts. You can create instances of these models in your tests with ease:

For provinces:

```
use OpenAfghanistan\Provinces\Models\Province;

Province::factory()->create();
```

For districts:

```
use OpenAfghanistan\Provinces\Models\District;

District::factory()->create();
```

**Contribution Guide:**

We welcome contributions to enhance this package. If you'd like to contribute by adding districts to any province, specific seeder files are available for each province to simplify the process. Please run the `./vendor/bin/pint` command before you push any piece of code.

**License:**

The "provinces" package is open-source software distributed under the [MIT License](https://opensource.org/licenses/MIT). You are free to use and modify it to suit your project's requirements.

Feel free to utilize this package to manage Afghanistan's administrative divisions effortlessly in your Laravel application.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance63

Regular maintenance activity

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 60% 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 ~67 days

Recently: every ~190 days

Total

13

Last Release

211d ago

Major Versions

0.5.0 → 1.02023-11-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/84455896?v=4)[ef-factory](/maintainers/ef-factory)[@EF-Factory](https://github.com/EF-Factory)

---

Top Contributors

[![hoshmandaqil](https://avatars.githubusercontent.com/u/57030631?v=4)](https://github.com/hoshmandaqil "hoshmandaqil (12 commits)")[![NanoNulla](https://avatars.githubusercontent.com/u/21290137?v=4)](https://github.com/NanoNulla "NanoNulla (7 commits)")[![NabizadaAbida](https://avatars.githubusercontent.com/u/31917110?v=4)](https://github.com/NabizadaAbida "NabizadaAbida (1 commits)")

---

Tags

afghanistanprovinceslaravelprovincesafghanistanafghanistan provincesafghanistan provinces laravel

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/open-afghanistan-provinces/health.svg)

```
[![Health](https://phpackages.com/badges/open-afghanistan-provinces/health.svg)](https://phpackages.com/packages/open-afghanistan-provinces)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[offload-project/laravel-toggle

A simple and flexible feature toggle (feature flag) package for Laravel

251.6k](/packages/offload-project-laravel-toggle)[promethys/revive

A 'RecycleBin' page where users can restore or delete permanently soft-deleted models.

162.9k](/packages/promethys-revive)

PHPackages © 2026

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