Skip to content

Commit 374f256

Browse files
authoredSep 13, 2018
Documentation
1 parent 3944581 commit 374f256

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
 

‎readme.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
1+
# Validate a phone number
2+
3+
Using Laravel's powerful validation feature.
4+
15
## Requirements
26

37
- PHP >= 7.0.0
48
- Laravel >= 5.5
59

10+
## Installation
11+
12+
Install the package via the Composer package manager:
13+
14+
```bash
15+
$ composer require soved/laravel-phone-number-validation
16+
```
17+
18+
## Usage
19+
20+
You may use the phone number validation as any other validation rule:
21+
22+
```php
23+
<?php
24+
25+
$request->validate([
26+
'phone_number' => 'required|string|phone_number',
27+
]);
28+
29+
```
30+
31+
If needed, you may customize the validation error message by adding an entry to the validation language file:
32+
33+
```php
34+
'phone_number' => 'The phone number format is invalid.',
35+
36+
'accepted' => 'The :attribute must be accepted.',
37+
38+
// The rest of the validation error messages...
39+
```
40+
641
## Security Vulnerabilities
742

843
If you discover a security vulnerability within this project, please send an e-mail to Sander de Vos via [sander@tutanota.de](mailto:sander@tutanota.de). All security vulnerabilities will be promptly addressed.

0 commit comments

Comments
 (0)