check mobile or email in laravel

Solutions on MaxInterview for check mobile or email in laravel by the best coders in the world

showing results for - "check mobile or email in laravel"
Lennart
30 May 2017
1protected function credentials(Request $request)
2        {
3          if(is_numeric($request->get('email'))){
4            return ['phone'=>$request->get('email'),'password'=>$request->get('password')];
5          }
6          elseif (filter_var($request->get('email'), FILTER_VALIDATE_EMAIL)) {
7            return ['email' => $request->get('email'), 'password'=>$request->get('password')];
8          }
9          return ['username' => $request->get('email'), 'password'=>$request->get('password')];
10        }