PHPackages                             christianjombo/laravel-nigerian-phone-validator - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. christianjombo/laravel-nigerian-phone-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

christianjombo/laravel-nigerian-phone-validator
===============================================

Validate Nigerian Phone Numbers in Laravel

4311PHPCI failing

Since Sep 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/christianjombo/laravel-nigerian-phone-validator)[ Packagist](https://packagist.org/packages/christianjombo/laravel-nigerian-phone-validator)[ RSS](/packages/christianjombo-laravel-nigerian-phone-validator/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-nigerian-phone-validator
================================

[](#laravel-nigerian-phone-validator)

Guard your application from problems resulting from improperly validated and formatted Phone Numbers. Send Transactional SMS with your mind at rest. Validate Nigerian Phone Numbers in your Laravel app.

### Introduction

[](#introduction)

This package can be used to validate Nigerian mobile phone numbers. It also provides a helper function to return the validated number in either local or international format.

Installation
------------

[](#installation)

[PHP](https://php.net) 5.5+ or [HHVM](http://hhvm.com) 3.3+, and [Composer](https://getcomposer.org) are required.

To get the latest version of Laravel Password, simply add the following line to the require block of your `composer.json` file.

```
"christianjombo/laravel-nigerian-phone-validator": "1.0.*"

```

You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated.

- If you're on Laravel 5.5 or above, that's all you need to do! Check out the usage examples below.
- If you're on Laravel &lt; 5.5, you'll need to register the service provider. Open up `config/app.php` and add the following to the `providers` array:

```
ChristianJombo\NigerianPhone\NigerianPhoneServiceProvider::class
```

Usage
-----

[](#usage)

Use the rule `nigerian_phone` in your validation like so:

```
/**
 * Get a validator for an incoming registration request.
 *
 * @param  array  $data
 * @return \Illuminate\Contracts\Validation\Validator
 */
protected function validator(array $data)
{
    return Validator::make($data, [
        'phone' => ['required', 'nigerian_phone'],
    ]);
}
```

By default, the error message returned is `The Phone Number is not a valid Nigerian Phone Number!`.

You can customize the error message by opening `resources/lang/en/validation.php` and adding to the array like so:

```
  'nigerian_phone' => 'Your phone number no be from naija',
```

### Helper function

[](#helper-function)

The package exposes the `nigerian_phone()` helper function that returns a nigerian number formatted to international format (e.g +2348066128880), if `$local` is set to false or not provided. If `$local` is provided and set to true, a local number (e.g 08066128880) is returned. By default, `$local` is set to false:

```
nigerian_phone($number, $local = false)
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

Inspiration
-----------

[](#inspiration)

- [Prosper Otemuyiwa](https://github.com/unicodeveloper/laravel-password)

How can I thank you?
--------------------

[](#how-can-i-thank-you)

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Biko, Spread the word!

Don't forget to [follow me on twitter](https://twitter.com/christianjombo)!

Thanks! Christian Jombo.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/62b7de1b582c174fe79c5c24ae35346b1620231bfffbd0a5647b59d605866297?d=identicon)[christianjombo](/maintainers/christianjombo)

---

Top Contributors

[![christianjombo](https://avatars.githubusercontent.com/u/30735214?v=4)](https://github.com/christianjombo "christianjombo (9 commits)")

---

Tags

laravelnigeriaphonevalidation

### Embed Badge

![Health badge](/badges/christianjombo-laravel-nigerian-phone-validator/health.svg)

```
[![Health](https://phpackages.com/badges/christianjombo-laravel-nigerian-phone-validator/health.svg)](https://phpackages.com/packages/christianjombo-laravel-nigerian-phone-validator)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
