1protected function credentials(Request $request)
2 {
3 if(is_numeric($request->get('phone'))){
4 return ['phone'=>$request->get('phone'),'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('username'), 'password'=>$request->get('password')];
10 }