fatmasaad/laravel-locations-egypt
Composer 安装命令:
composer require fatmasaad/laravel-locations-egypt
包简介
Laravel - Countries[States/Cities, Currency, Phone Code, Languages, Capital] & Continents & Timezones. Enhanced with Egypt cities support.
README 文档
README
Enhanced Laravel Locations package with Cities/Districts support, including comprehensive Egypt cities data.
Features
This package provides quick and easy methods to get:
- ✅ Timezones
- ✅ Continents
- ✅ Countries (with Currency, Phone Code, Languages, Capital)
- ✅ States/Provinces
- ✅ Cities/Districts (NEW!) - With full Egypt cities support
- ✅ Multi-language support (English & Arabic)
Installation
composer require fatmasaad/laravel-locations-egypt
Usage
Get Countries
$countries = getCountries();
$egypt = getCountry('EG');
Get States
$states = getStates('EG'); // Get all Egypt states
$cairo = getState('C', 'EG'); // Get Cairo state
Get Cities/Districts (NEW!)
// Get all cities for Egypt (all governorates)
$allCities = getCities('EG');
// Get cities for Cairo Governorate
$cairoCities = getCities('EG', 'C');
// Get cities in Arabic
$cairoCitiesAr = getCities('EG', 'C', 'ar');
// Get a specific city
$city = getCity('C001', 'EG', 'C'); // Returns "Cairo"
$cityAr = getCity('C001', 'EG', 'C', 'ar'); // Returns "القاهرة"
Get Cities for Giza Governorate
$gizaCities = getCities('EG', 'GZ');
// Returns: Giza, 6th of October City, Agouza, Dokki, etc.
$gizaCitiesAr = getCities('EG', 'GZ', 'ar');
// Returns: الجيزة، مدينة السادس من أكتوبر، العجوزة، الدقي، إلخ
Egypt Cities Coverage
All 26 Egyptian governorates are included with their major cities:
- Alexandria (ALX) - 13 cities
- Aswan (ASN) - 7 cities
- Asyut (AST) - 10 cities
- Beheira (BH) - 13 cities
- Beni Suef (BNS) - 7 cities
- Cairo (C) - 35 cities
- Dakahlia (DK) - 14 cities
- Damietta (DT) - 6 cities
- Faiyum (FYM) - 7 cities
- Gharbia (GH) - 9 cities
- Giza (GZ) - 22 cities
- Ismailia (IS) - 7 cities
- Kafr el-Sheikh (KFS) - 9 cities
- Luxor (LX) - 7 cities
- Matrouh (MT) - 7 cities
- Minya (MN) - 7 cities
- Monufia (MNF) - 8 cities
- New Valley (WAD) - 5 cities
- North Sinai (SIN) - 6 cities
- Port Said (PTS) - 2 cities
- Qalyubia (KB) - 6 cities
- Qena (KN) - 6 cities
- Red Sea (BA) - 6 cities
- Sohag (SHG) - 9 cities
- South Sinai (JS) - 8 cities
- Suez (SUZ) - 4 cities
Total: 26 governorates, 250+ cities with English and Arabic translations
Language Support
The package supports multiple languages. By default, it uses your application's locale:
// Uses app locale
app()->setLocale('ar');
$cities = getCities('EG', 'C'); // Returns Arabic names
app()->setLocale('en');
$cities = getCities('EG', 'C'); // Returns English names
// Or specify language explicitly
$cities = getCities('EG', 'C', 'ar');
$cities = getCities('EG', 'C', 'en');
Available Functions
Location Functions
getTimeZones($lang)- Get all timezonesgetContinents($lang)- Get all continentsgetContinent($code, $lang)- Get specific continentgetCountries($lang)- Get all countriesgetCountry($code, $lang)- Get specific countrygetCountriesNames($lang)- Get country names onlygetStates($country, $lang)- Get states for a countrygetState($code, $country, $lang)- Get specific stategetCurrencies()- Get all currencies
City Functions (NEW!)
getCities($country, $state, $lang)- Get cities for country/stategetCity($code, $country, $state, $lang)- Get specific city
Credits
This package is based on pharaonic/laravel-locations with enhanced cities support.
License
This package is open-sourced software licensed under the MIT license.
fatmasaad/laravel-locations-egypt 适用场景与选型建议
fatmasaad/laravel-locations-egypt 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「laravel」 「states」 「countries」 「locations」 「cities」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 fatmasaad/laravel-locations-egypt 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fatmasaad/laravel-locations-egypt 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 fatmasaad/laravel-locations-egypt 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP extension with Brazilian states and formats for CPF, CNPJ and ZIP
A simple PHP class for United States Postal Service (USPS) addresses
Convert and operate with FIPS codes for states, counties, etc.
PHP Countries and Currencies
Laravel 5.* Library for Malaysian states list
Library to create classes following the State pattern in PHP. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements and this improve maintainability and workflow writing.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-10