phumtech / laravel-cambodia-seeder
A comprehensive Cambodia geography seeder for Laravel providing Provinces, Districts, and Communes data.
Package info
github.com/phumtech/laravel-cambodia-seeder
pkg:composer/phumtech/laravel-cambodia-seeder
This package is auto-updated.
Last update: 2026-05-13 12:29:41 UTC
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.