Search by

mohamed-haroun / laravel-egypt-governorates

king980

The 27 Egyptian governorates (Arabic and English) with slugs, a Laravel validation rule and a select-options helper.

Package info

github.com/mohamed-haroun/laravel-egypt-governorates

pkg:composer/mohamed-haroun/laravel-egypt-governorates

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-12-02 09:10 UTC

This package is auto-updated.

Last update: 2026-12-02 09:45:59 UTC


README

The 27 Egyptian governorates, in Arabic and English, with stable slugs. Built for checkout forms, shipping zones and address validation.

العربية | English

composer require mohamed-haroun/laravel-egypt-governorates

Use

use MohamedHaroun\EgyptGovernorates\Governorates;

Governorates::name('cairo');          // القاهرة
Governorates::name('cairo', 'en');    // Cairo
Governorates::options();              // ['cairo' => 'القاهرة', ...] for a <select>
Governorates::has('giza');            // true
Governorates::slugs();                // 27 slugs

Validation rule:

use MohamedHaroun\EgyptGovernorates\Rules\Governorate;

$request->validate([
    'governorate' => ['required', new Governorate()],
]);

Shipping fees per governorate: key your own table by the slug.

$fees = ['cairo' => 40, 'giza' => 40, 'alexandria' => 55 /* ... */];
$fee = $fees[$request->governorate] ?? null;

The data lives in src/Governorates.php as a plain constant, so it has no database, no migration and no network calls.

بالعربي

حزمة فيها محافظات مصر الـ27 بالعربي والإنجليزي مع slug ثابت لكل محافظة. مناسبة لصفحة إتمام الطلب وحساب الشحن والتحقق من العنوان.

composer require mohamed-haroun/laravel-egypt-governorates
Governorates::options();   // قايمة جاهزة للـ select
'governorate' => ['required', new Governorate()],

Tests

composer install && vendor/bin/phpunit

License

MIT