tylercd100/laravel-validator-phone
Composer 安装命令:
composer require tylercd100/laravel-validator-phone
包简介
Validate that a phone number is in the correct format
README 文档
README
This Package has moved to here for laravel 5.5+. Please use that instead. Also check out these other community validation rules
This package only checks phone number formatting and not actual number validity.
Installation
Install via composer - In the terminal:
composer require tylercd100/laravel-validator-phone
Now add the following to the providers array in your config/app.php
Tylercd100\Validator\Phone\ServiceProvider::class
Usage
// Test any phone number Validator::make(['test' => '15556667777'], ['test' => 'phone']); //true Validator::make(['test' => '+15556667777'], ['test' => 'phone']); //true Validator::make(['test' => '+1 (555) 666-7777'], ['test' => 'phone']); //true // Test for E164 Validator::make(['test' => '+15556667777'], ['test' => 'phone:E164']); //true // Test for NANP (North American Numbering Plan) Validator::make(['test' => '+1 (555) 666-7777'], ['test' => 'phone:NANP']); //true // Test for digits only Validator::make(['test' => '15556667777'], ['test' => 'phone:digits']); //true
统计信息
- 总下载量: 4.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-02-14