sadegh19b/laravel-iran-cities

A Laravel package for Iran provinces and cities seeder and models

Installs: 47

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/sadegh19b/laravel-iran-cities

v2.0.0 2025-12-17 02:05 UTC

This package is auto-updated.

Last update: 2025-12-17 02:08:37 UTC


README

A Laravel package for Iran provinces, counties and cities seeder and models.

This package uses this repo for list of cities (Thanks to @sajaddp).

Supports Laravel 8 to 12.

Installation

You can install the package via composer:

composer require sadegh19b/laravel-iran-cities

Quick Start

  1. Publish migrations (optional):
php artisan vendor:publish --tag=iran-cities-migrations
  1. Run migrations:
php artisan migrate
  1. Run the seeder:
php artisan db:seed --class="Sadegh19b\LaravelIranCities\Seeders\IranCitiesSeeder"
  1. Use the models:
use Sadegh19b\LaravelIranCities\Models\Province;
use Sadegh19b\LaravelIranCities\Models\County;
use Sadegh19b\LaravelIranCities\Models\City;

// Get all provinces
$provinces = Province::all();

// Get counties of a province
$province = Province::find(1);
$counties = $province->counties;

// Get cities of a province
$province = Province::find(1);
$cities = $province->cities;

// Get cities of a county
$county = County::find(1);
$cities = $county->cities;

License

The MIT License (MIT). Please see License File for more information.