phumtech/laravel-cambodia-seeder

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

Maintainers

Package info

github.com/phumtech/laravel-cambodia-seeder

pkg:composer/phumtech/laravel-cambodia-seeder

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-04-08 16:46 UTC

This package is auto-updated.

Last update: 2026-05-13 12:29:41 UTC


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.