Download the PHP package iraq-laravel/phone without Composer
On this page you can find all versions of the php package iraq-laravel/phone. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download iraq-laravel/phone
More information about iraq-laravel/phone
Files in iraq-laravel/phone
Package phone
Short Description Iraqi phone number validation, operator detection, and E.164 normalization for Laravel.
License MIT
Informations about the package phone
iraq-laravel/phone
Iraqi phone number validation, operator detection, and E.164 normalization for Laravel.
Features
- Validate Iraqi mobile and landline numbers
- Detect operator: Zain, Asiacell, Korek, Alkafeel Omnnea
- Normalize any input format to E.164 (
+9647XXXXXXXXX) - Detect all verified governorate landline area codes (Arabic + English + Kurdish Sorani)
- Laravel validation rule — object-based and shorthand string
- Restrict validation to specific operators
- Zero external dependencies — pure PHP
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
Installation
The service provider and facade register automatically. No manual setup needed.
Optionally publish the config and translation strings:
You can also publish just the config using the legacy tag:
The package includes translations for English, Arabic, and Kurdish (Sorani). After publishing, edit them under resources/lang/vendor/iraqi-phone/{locale}/validation.php.
Quick start
Accepted input formats
All of the following resolve to the same number:
Mobile operators
| Operator | Prefixes | Arabic |
|---|---|---|
| Zain Iraq | 0780–0789, 0790–0799 | زين العراق |
| Asiacell | 0770–0779 | آسياسيل |
| Korek Telecom | 0750–0759 | كورك تيليكوم |
| Alkafeel Omnnea | 0760–0769 | الكفيل أمنية |
Note: Iraq has Mobile Number Portability (MNP). A prefix may not reflect the subscriber's current operator after porting.
Landline area codes
All verified codes from the Iraqi national numbering plan.
| Area code | City / Governorate | Arabic |
|---|---|---|
| 1 | Baghdad | بغداد |
| 21 | Tikrit / Saladin | تكريت / صلاح الدين |
| 23 | Kut / Wasit | الكوت / واسط |
| 24 | Ramadi / Anbar | الرمادي / الأنبار |
| 25 | Baquba / Diyala | بعقوبة / ديالى |
| 30 | Hillah / Babil | الحلة / بابل |
| 32 | Karbala | كربلاء |
| 33 | Najaf | النجف |
| 36 | Diwaniya / Al-Qadisiyyah | الديوانية / القادسية |
| 37 | Samawa / Al-Muthanna | السماوة / المثنى |
| 40 | Basra | البصرة |
| 42 | Nasiriya / Dhi Qar | الناصرية / ذي قار |
| 43 | Amara / Maysan | العمارة / ميسان |
| 50 | Kirkuk | كركوك |
| 53 | Sulaymaniyah | السليمانية |
| 60 | Mosul / Nineveh | الموصل / نينوى |
| 62 | Duhok | دهوك |
| 66 | Erbil | أربيل |
| 67 | Halabja | حلبجة |
Validation
Object-based rule (recommended)
Shorthand string rules
Inside a Form Request
Landline parsing
toArray() — for API responses
Without the facade
Exception handling
parse() throws InvalidIraqiPhoneNumberException for unrecognized input. Use isValid() to check first:
Running tests
License
MIT — see LICENSE.
Author
All versions of phone with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/validation Version ^10.0|^11.0|^12.0