Answers for "validate tel in laravel"

PHP
7

numbric validate laravel

$rules = ['Fno' => 'numeric|min:2|max:5', 'Lno' => 'numeric|min:2'];
Posted by: Guest on November-01-2020
0

laravel validate telephone number

SEVERAL WAYS TO DO IT:
------
* by using regex in the suitable Laravel Controller:

'phone' => 'required|regex:/(01)[0-9]{9}/' => ( add 'required' only if the field is required, else delete it!)
OR smthin like dis
'phone_number' => 'required|regex:/^([0-9\s\-\+\(\)]*)$/|min:10'
---------
* use this library: https://github.com/propaganistas/laravel-phone
---------
* use this in the corresponding laravel Controller:

 'phone' => 'required | numeric | digits:10 | starts_with: 6,7,8,9'
---------
* You can use a service like Nexmo or Twilio if you need to properly validate phone numbers.
Posted by: Guest on December-23-2021

Browse Popular Code Answers by Language