phumtech/laravel-cambodia-seeder
Composer 安装命令:
composer require phumtech/laravel-cambodia-seeder
包简介
A comprehensive Cambodia geography seeder for Laravel providing Provinces, Districts, and Communes data.
README 文档
README
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\ProvincePhumtech\CambodiaSeeder\Models\DistrictPhumtech\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.
phumtech/laravel-cambodia-seeder 适用场景与选型建议
phumtech/laravel-cambodia-seeder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 phumtech/laravel-cambodia-seeder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phumtech/laravel-cambodia-seeder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-08