PHPackages                             njoguamos/laravel-kenya-mobile - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. njoguamos/laravel-kenya-mobile

ActiveLibrary

njoguamos/laravel-kenya-mobile
==============================

A rule for validating Kenya mobile number in a Laravel 11+ application.

v3.0.0(1mo ago)76.1k↓20.9%1MITPHPPHP ^8.3 || ^8.4 || ^8.5CI passing

Since Feb 12Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/njoguamos/laravel-kenya-mobile)[ Packagist](https://packagist.org/packages/njoguamos/laravel-kenya-mobile)[ Docs](https://github.com/njoguamos/laravel-kenya-mobile)[ RSS](/packages/njoguamos-laravel-kenya-mobile/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (11)Versions (16)Used By (0)

[![Art work](/art.png)](/art.png)

Validate Kenyan Mobile Phone
============================

[](#validate-kenyan-mobile-phone)

[![Latest Version on Packagist](https://camo.githubusercontent.com/32e8045fb6f78361ff84164012d0782f791d10e61d7588339b525009549b7188/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6a6f6775616d6f732f6c61726176656c2d6b656e79612d6d6f62696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/njoguamos/laravel-kenya-mobile)[![GitHub Tests Action Status](https://camo.githubusercontent.com/35da939250db9b29f73f27a4fccde55d7f79de6c7e94a7766e68f9db8633d11a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e6a6f6775616d6f732f6c61726176656c2d6b656e79612d6d6f62696c652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/njoguamos/laravel-kenya-mobile/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/828898ac8d3a6e2d95418afa35c1f35ceab8473c813c7d080238364baa278943/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e6a6f6775616d6f732f6c61726176656c2d6b656e79612d6d6f62696c652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/njoguamos/laravel-kenya-mobile/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/6b3f3386d8c63cf36498a4e53cc9a2a66a7e8ba2f84577661d4c51f1008f4c32/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6a6f6775616d6f732f6c61726176656c2d6b656e79612d6d6f62696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/njoguamos/laravel-kenya-mobile)

A rule for validating Kenyan mobile number. You can either validate phone number with 9 or 10 digits such as `700325008` or `0700325008` or validate full phone number such as `254700325008`.

1. Why use this package
-----------------------

[](#1-why-use-this-package)

1. Save time from implementing your own validation rule.
2. Tested with phone number approved by [Communications Authority of Kenya](https://www.ca.go.ke/wp-content/uploads/2023/01/Telecommunication-Numbering-Plan-for-Kenya-January-2023.pdf) supported.

2. Installation
---------------

[](#2-installation)

VersionSupported Laravel1.x9.x, 10.x2.x11.x, 12.x3.x12.x, 13.xYou can install the package via composer:

```
composer require njoguamos/laravel-kenya-mobile
```

3. Usage
--------

[](#3-usage)

### 3.1 Inside a form request

[](#31-inside-a-form-request)

```
