定制 sadegh19b/laravel-iran-cities 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sadegh19b/laravel-iran-cities

最新稳定版本:v2.0.0

Composer 安装命令:

composer require sadegh19b/laravel-iran-cities

包简介

A Laravel package for Iran provinces and cities seeder and models

README 文档

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.

统计信息

  • 总下载量: 47
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-01