Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to validate email or phone number single parameter request in laravel

protected function credentials(Request $request)
        {
          if(is_numeric($request->get('phone'))){
            return ['phone'=>$request->get('phone'),'password'=>$request->get('password')];
          }
          elseif (filter_var($request->get('email'), FILTER_VALIDATE_EMAIL)) {
            return ['email' => $request->get('email'), 'password'=>$request->get('password')];
          }
          return ['username' => $request->get('username'), 'password'=>$request->get('password')];
        }
Comment

PREVIOUS NEXT
Code Example
Php :: 279.00 to php 
Php :: laravel openstreetmap 
Php :: popup en php 
Php :: syntax error, unexpected variable "$result" in D:wordpressxampphtdocs empleteuser_delete.php on line 13 
Php :: désinfecte email php 
Php :: php decrement variable by 1 
Php :: php imap before date subject 
Php :: DateTimeZone not found laravel 
Php :: propel find index 
Php :: woocommerce validar campos personalizados en el checkout 
Php :: php expire session for 1 month 
Php :: php form validation and submit to database 
Php :: add attachment to the invoice laravel 
Php :: php discord webhook sender 
Php :: wp_query not have term 
Php :: does grepper use PHP 
Php :: tutorial crud phpmyadmin 
Php :: php printf percent sign 
Php :: Laravel - Controller get select value from Views 
Php :: php array dot notation 
Php :: array fill key use in php project 
Php :: codecept run single test 
Php :: how to pass variable to an event listener laravel 
Php :: plesk change php version 
Php :: wordpress custom end point 
Php :: how to change laravel logo image 
Php :: laravel collection intersectKey 
Php :: laravel count 
Php :: require and include difference in laravel 
Php :: utf8 decode 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =