PHPackages                             shimadotdev/iran-regions - 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. shimadotdev/iran-regions

ActiveLaravel-package[Utility &amp; Helpers](/categories/utility)

shimadotdev/iran-regions
========================

A Laravel package containing province and city data of Iran, including calling codes, along with geolocation functionality. Ideal for managing location-based information within Laravel apps.

1.2.1(1y ago)1745MITPHPPHP &gt;=8.0

Since Jun 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/shimadotdev/iran-regions)[ Packagist](https://packagist.org/packages/shimadotdev/iran-regions)[ RSS](/packages/shimadotdev-iran-regions/feed)WikiDiscussions main Synced 1mo ago

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

[![Latest Stable Version](https://camo.githubusercontent.com/25716da89fc0d42eabe79cf6ad31d0ff0fba09963965a3f94a2dad60386c2645/68747470733a2f2f706f7365722e707567782e6f72672f7368696d61646f746465762f6972616e2d726567696f6e732f76)](https://packagist.org/packages/shimadotdev/iran-regions) [![Total Downloads](https://camo.githubusercontent.com/9b2cea4b42dbd36adfe90af98ed30b81a20d98e1e0be3e89a931fbce96a41219/68747470733a2f2f706f7365722e707567782e6f72672f7368696d61646f746465762f6972616e2d726567696f6e732f646f776e6c6f616473)](https://packagist.org/packages/shimadotdev/iran-regions) [![Tests](https://github.com/shimadotdev/iran-regions/actions/workflows/test.yml/badge.svg)](https://github.com/shimadotdev/iran-regions/actions/workflows/test.yml) [![License](https://camo.githubusercontent.com/006a0f04b4258bf99857d92d21a4eb10d2199fb00fe6241561a6e3c217e1d1a3/68747470733a2f2f706f7365722e707567782e6f72672f7368696d61646f746465762f6972616e2d726567696f6e732f6c6963656e7365)](https://packagist.org/packages/shimadotdev/iran-regions) [![PHP Version Require](https://camo.githubusercontent.com/b20a5541cf78401aa8e1cd7b2091ee6adef220470da7a47f5f51f63c4c9e4343/68747470733a2f2f706f7365722e707567782e6f72672f7368696d61646f746465762f6972616e2d726567696f6e732f726571756972652f706870)](https://packagist.org/packages/shimadotdev/iran-regions)

Iran Regions Laravel Package
============================

[](#iran-regions-laravel-package)

A Laravel package containing province and city data of Iran, including calling codes, along with geolocation functionality. Ideal for managing location-based information within Laravel apps.

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

[](#installation)

You can install the package via Composer by running:

```
composer require shimadotdev/iran-regions
```

After installing the package, run the following Artisan command to set up the necessary migrations and seed the database with provided data:

```
php artisan iran-regions:install
```

This command will create two tables named cities and provinces in your database, seeded with the required data.

Usage
-----

[](#usage)

Once the package is installed and migrations are run, you can start using the provided functionality.

Example Usage
-------------

[](#example-usage)

You can access province and city data using the `Iran` Class:

```
use Shimadotdev\IranRegions\Iran;;

// Get a province by its slug
$province = Iran::province()->where('slug', '=', 'tehran')->first();

// Get all provinces with their slugs and calling codes
$provinces = Iran::province()->get(['slug', 'calling_code']);

//Update a city
$provinces = Iran::city()->where('slug', '=', 'qom')->update(['is_active'=> 0]);

//Relations
Iran::province()->with('cities')->get();

Iran::province()->find(3)->cities;

Iran::City()->with('province')->get();

Iran::City()->where('slug', 'naeen')->first()?->province->slug;
```

As you see, you can also utilize Laravel's Eloquent ORM to create custom queries and interact with the data as usual.

Localization Support
--------------------

[](#localization-support)

The package supports two languages: English (en) and Persian (fa) for all city and province names. You can access them using their respective slugs:

```
trans('iranRegions::slug.' . $province->slug);
```

Database Structure
------------------

[](#database-structure)

The package creates the following tables in your database:

#### `cities` Table

[](#cities-table)

ColumnDescriptionidPrimary keyslugCity slugis\_activeActive statusprovince\_idForeign key to provinces tablelatitudeCity latitudelongitudeCity longitude#### `provinces` Table

[](#provinces-table)

ColumnDescriptionidPrimary keyslugProvince slugis\_activeActive statuslatitudeProvince latitudelongitudeProvince longitudecalling\_codeCalling code of the provinceTesting
-------

[](#testing)

You can run the automated tests for the package using PHPUnit:

```
phpunit
```

Contributing
------------

[](#contributing)

Contributions are welcome! If you have any ideas for improvements or find any issues, please submit them through GitHub issues or create a pull request.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover any security vulnerabilities, please report them via email to

Credits
-------

[](#credits)

This package is developed and maintained by [Shima.Dev](https://shima.dev)

License
-------

[](#license)

This package is open-source software licensed under the [MIT licensev](https://opensource.org/licenses/MIT).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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 ~13 days

Total

4

Last Release

661d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18c19a0071bc8050aff5478a9f495be848153ff97e61f309dc4865e29df7ce6f?d=identicon)[shimdotdev](/maintainers/shimdotdev)

---

Top Contributors

[![shimadotdev](https://avatars.githubusercontent.com/u/155004252?v=4)](https://github.com/shimadotdev "shimadotdev (32 commits)")

---

Tags

phplaraveliraniran-citiesiran regionsiran-geo-coordinates

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shimadotdev-iran-regions/health.svg)

```
[![Health](https://phpackages.com/badges/shimadotdev-iran-regions/health.svg)](https://phpackages.com/packages/shimadotdev-iran-regions)
```

###  Alternatives

[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[salmanzafar/laravel-geocode

A Laravel Library to find Lat and Long of a given Specific Address

153.9k](/packages/salmanzafar-laravel-geocode)

PHPackages © 2026

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