mohamed-haroun / laravel-egypt-governorates
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
Requires
- php: ^8.2
- illuminate/contracts: ^11.0|^12.0
Requires (Dev)
- phpunit/phpunit: ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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