njoguamos/laravel-kenya-mobile 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

njoguamos/laravel-kenya-mobile

Composer 安装命令:

composer require njoguamos/laravel-kenya-mobile

包简介

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

README 文档

README

Art work

Validate Kenyan Mobile Phone

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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. Save time from implementing your own validation rule.
  2. Tested with phone number approved by Communications Authority of Kenya supported.

2. Installation

Version Supported Laravel
1.x 9.x, 10.x
2.x 11.x, 12.x
3.x 12.x, 13.x

You can install the package via composer:

composer require njoguamos/laravel-kenya-mobile

3. Usage

3.1 Inside a form request

<?php

namespace App\Http\Requests;

use NjoguAmos\KeMobile\KenyaMobileFullRule;
use NjoguAmos\KeMobile\KenyaMobileRule;
use Illuminate\Foundation\Http\FormRequest;

class RegisterUserRequest extends FormRequest
{
    /** @return array<string, mixed> */
    public function rules(): array
    {
        return [
            // ... other rules
            // Validate phone number with 9 or 10 digits
            'phone'    => ['nullable', new KenyaMobileRule(),'unique:users,phone'],
            // Or validate full phone number
            'full_phone'    => ['nullable', new KenyaMobileFullRule(),'unique:users,full_phone'],
        ];
    }
}

3.2 Supported mobile numbers

Carrier Prefix
Airtel Networks Kenya Ltd 100, 101, 102, 103, 104, 105, 106
Safaricom PLC 110, 111, 112, 113, 114, 115
Jambo Telcoms Ltd 120
Infura Ltd 124
Hidiga Investments Ltd 126
Webtribe Ltd 128
NRG Media Ltd 130
Safaricom PLC 700, 701, 702, 703, 704, 705, 706, 707, 708, 709
Safaricom PLC 710, 711, 712, 713, 714, 715, 716, 717, 718, 719
Safaricom PLC 720, 721, 722, 723, 724, 725, 726, 727, 728, 729
Airtel Networks Kenya Ltd 730, 731, 732, 733, 734, 735, 736, 737, 738, 739
Safaricom PLC 740, 741, 742, 743
Homelands Media Ltd 744
Safaricom PLC 745, 746
Jamii Telecoms Ltd 747
Safaricom Ltd 748
IEBC in KIEMS Kits 749
Airtel Networks Kenya Ltd 750, 751, 752, 753, 754, 755, 756
Safaricom Ltd 757, 758, 759
Mobile Pay Ltd 760
Eferio Kenya Ltd 761
Airtel Networks Kenya Ltd 762
Finserve Africa Ltd 763, 764, 765, 766
Airtel Networks Kenya Ltd 767
Safaricom PLC 768, 769
Telkom Kenya Ltd 770, 771, 772, 773, 774, 775, 776, 777, 778, 779
Airtel Networks Kenya Ltd 780, 781, 782, 783, 784, 785, 786, 787, 788, 789
Safaricom PLC 790, 791, 792, 793, 794, 795, 796, 797, 798, 799

4. Testing

composer test

5. Changelog

Please see RELEASES for more information what has changed recently.

6. Contributing

Please see CONTRIBUTING for details.

7. Security Vulnerabilities

If you discover any security related issues, please email njoguamos@gmail.com instead of using the issue tracker.

8. Credits

9. License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 6.92k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固