承接 phumtech/laravel-cambodia-seeder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

phumtech/laravel-cambodia-seeder

最新稳定版本:v1.0.0

Composer 安装命令:

composer require phumtech/laravel-cambodia-seeder

包简介

A comprehensive Cambodia geography seeder for Laravel providing Provinces, Districts, and Communes data.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads License PHP Version Require

A comprehensive, production-ready Laravel package providing a complete database of Cambodian geography. This include migrations, seeders, and fully-mapped Eloquent Models for Provinces, Districts, and Communes. Perfect for KYC, address forms, and localized applications in Cambodia.

🗺️ Coverage Data

This package provides the most up-to-date administrative divisions of Cambodia:

  • 25 Provinces (including Phnom Penh Municipality)
  • 210 Districts (Srok/Krong/Khan)
  • 1,652 Communes (Khum/Sangkat)
  • Bilingual Support: All data includes names in both English and Khmer.

🚀 Installation

Install the package via Composer:

composer require phumtech/laravel-cambodia-seeder

The package supports PHP 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, and 8.5.

The package will automatically register its service provider.

🛠️ Setup & Seeding

1. Run Migrations

Create the provinces, districts, and communes tables:

php artisan migrate

2. Seed the Database

Populate the tables with the Cambodian geography data:

php artisan cambodia:seed

📖 Usage

This package provides ready-to-use Eloquent Models with pre-defined relationships.

The Models

  • Phumtech\CambodiaSeeder\Models\Province
  • Phumtech\CambodiaSeeder\Models\District
  • Phumtech\CambodiaSeeder\Models\Commune

Example: Fetching Geography Data

use Phumtech\CambodiaSeeder\Models\Province;

// Get all provinces with their districts and communes
$provinces = Province::with('districts.communes')->get();

// Find a specific province by English name
$siemReap = Province::where('name_en', 'Siemreap')->first();

echo "Province: " . $siemReap->name_kh; // សៀមរាប

foreach ($siemReap->districts as $district) {
    echo "District: " . $district->name_en;
}

⚙️ Customization

If you need to modify the raw datasets before seeding, you can publish the CSV files:

php artisan vendor:publish --tag=cambodia-data

The CSV data will be available in your application's database/data/cambodia directory. Running the seed command will prioritize these local files if they exist.

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

🛡️ Security

If you discover any security-related issues, please email chheanlymeng.dev@gmail.com instead of using the issue tracker.

📜 License

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

SEO Keywords

Cambodia geography, Laravel provinces seeder, Cambodia districts database, Khmer address database, Cambodia administrative divisions, Phumtech, Laravel Cambodia geography, Cambodia cities list.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固