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 }