Laravel phone number validation

2019-12-10 17:09:00 Andrew Laravel

How to validate phone number in Laravel Framework?

Laravel did not provide any inbuilt validation method for validating phone no. The only way to validate phone no in laravel is through regex.

Laravel phone validation Example

'phone' => 'required|regex:/(01)[0-9]{9}/'

The above regex will check the submitted input starts with 01 and is followed by 9 numbers.


This post is submitted by one of our members. You may submit a new post here.

Related Tricks