Last active
November 5, 2022 17:35
-
-
Save arshohag/b78dfb63a74253ca9d38167b3b6a7aea to your computer and use it in GitHub Desktop.
Singapore Phone Number validation in Laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $this->validate($request, [ | |
| 'phone' => 'regex:/^\+65(6|8|9)\d{7}$/', | |
| ]); | |
| // It will validate SG phone numbers without a required parameter in laravel using validator. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment