PHPackages                             mahdiabbariki/iranprovinces - 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. mahdiabbariki/iranprovinces

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

mahdiabbariki/iranprovinces
===========================

This package includes models and tables for provinces and their respective cities, which will be integrated into your project.

1.2.0(2y ago)2164MITPHP

Since Feb 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Mahdi-Abbariki/IranProvinces)[ Packagist](https://packagist.org/packages/mahdiabbariki/iranprovinces)[ RSS](/packages/mahdiabbariki-iranprovinces/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

Iran Provinces Package
======================

[](#iran-provinces-package)

This package offers functionality to manage Iran's provinces and cities through database tables. It comes with flexible configuration options, allowing you to:

- Choose whether or not to create a table for cities.
- Decide whether to include latitude and longitude data in the cities table.
- Add or exclude timestamps in the tables.

Persian Install Guide
---------------------

[](#persian-install-guide)

[راهنمای نصب فارسی](Persian_ReadMe.md)

Installation
------------

[](#installation)

To get started, run the following command:

```
    composer require MahdiAbbariki/IranProvinces
```

For Laravel Versions Prior to v6
--------------------------------

[](#for-laravel-versions-prior-to-v6)

For Laravel versions older than v6, you need to add the following line to the `providers` array in the `config/app.php` file:

```
    'providers' => [
    // ...
    MahdiAbbariki\IranProvinces\IranProvincesServiceProvider::class, // Add this line at the end of the provider array
    ],
```

---

the package is successfully integrated into your project.

After that, run the following command to publish the package's configuration, migration, and seeder files:

```
    php artisan vendor:publish --provider="MahdiAbbariki\IranProvinces\IranProvincesServiceProvider"
```

Make sure to edit the configuration file ( `config/iranProvinces.php` ) to match your specific requirements. The default configurations are suitable for most users.

Once you've customized the configuration, run your migrations.

```
    php artisan migrate
```

Seeding
-------

[](#seeding)

You have two options for seeding the data.

You can execute this command to run the designated seeders included with this package:

```
    php artisan province:seed
```

Alternatively, you can add the following lines to the `run` method in the `DatabaseSeeder` class located in the `database/seeders` directory:

```
    $this->call([
        //...
        \MahdiAbbariki\IranProvinces\Database\Seeders\IranProvincesTableSeeder::class,
        \MahdiAbbariki\IranProvinces\Database\Seeders\IranProvincesCitiesTableSeeder::class,
        //...
    ]);
```

then you can use the built-in laravel seed command:

```
    php artisan db:seed
```

---

Now, your models and tables are ready for use.

Examples
--------

[](#examples)

Here are some examples of how to use them:

```
    use MahdiAbbariki\IranProvinces\Models\Province;
    use MahdiAbbariki\IranProvinces\Models\City;

    $province = Province::find(1);
    $cities = $province->cities;

    $city = City::find(1);
    $province = $city->province;
```

Contribution
------------

[](#contribution)

If you encounter any bugs, please report them to . Your contributions are welcome!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Every ~235 days

Total

5

Last Release

961d ago

Major Versions

v0.1.2RC1 → 1.1.02023-09-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/84b90ef5f974df49233bf0ee07e5e4f2a5c54110f5c7f4367b9ad8375b3426d8?d=identicon)[MahdiAbbariki](/maintainers/MahdiAbbariki)

---

Top Contributors

[![Mahdi-Abbariki](https://avatars.githubusercontent.com/u/17335469?v=4)](https://github.com/Mahdi-Abbariki "Mahdi-Abbariki (15 commits)")

---

Tags

databaseslaravellocationlocationcityprovinceiran

### Embed Badge

![Health badge](/badges/mahdiabbariki-iranprovinces/health.svg)

```
[![Health](https://phpackages.com/badges/mahdiabbariki-iranprovinces/health.svg)](https://phpackages.com/packages/mahdiabbariki-iranprovinces)
```

###  Alternatives

[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[salibhdr/typhoon-iran-cities

A laravel package for importing all regions such as provinces, counties, cities, city districts, rural districts and villages of iran into database accurately

6121.0k](/packages/salibhdr-typhoon-iran-cities)

PHPackages © 2026

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