Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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-9s-+()]*)$/|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.
Comment

laravel form validation phone number

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

validate phone number with dial code laravel 8

'mobile' => ['required', function ($attribute, $value, $fail) use ($parameters) {
                if (($value + strlen($parameters['code'])) < 15) {
                    $fail('Mobile number is too long');
                }
            }
Comment

PREVIOUS NEXT
Code Example
Php :: php datetime to timestamp 
Php :: how to get all roles in wordpress 
Php :: php favicon 
Php :: Composer detected issues in your platform: Your Composer dependencies require a PHP version "= 8.0.2". 
Php :: how to display array of img in wordpress 
Php :: how to remove public from url in laravel 
Php :: Use debug bar - Laravel 
Php :: how to use required_with in laravel to array element 
Php :: convert stdclass object to array php 
Php :: laravel wherehas 
Php :: laravel php 8 ububtu 
Php :: minuscule string php 
Php :: how to override default name for apiresourc route in laravel 
Php :: ext-bcmath php 8.0 install 
Php :: php check array is not associative 
Php :: tackle discount in php laravel blade 
Php :: get number of chars ina string php 
Php :: Laravel Session using Global Session php function 
Php :: Notice: Undefined property: enable_for_virtual 
Php :: how to find the name of login user in laravel 
Php :: wordpress get child posts 
Php :: php install xdebug mac 
Php :: laravel add utility class 
Php :: PHP str_replace — Replace all occurrences of the search string with the replacement string 
Php :: get raw query laravel 
Php :: laravel hasfile 
Php :: strtoupper 
Php :: get url parameters in laravel blade 
Php :: php confirm box 
Php :: Array Contant PHP 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =