I'm using Laravel
5.2 in a project and need the login form to use phonenumber instead of email for the credentials.
I do not want to edit any Illuminate package files.
I'm using Laravel
5.2 in a project and need the login form to use phonenumber instead of email for the credentials.
I do not want to edit any Illuminate package files.
You can manually authenticate the users:
public function authenticate(Request $request)
{
$password=$request->password;
$phone=$request->phone_number;
if (Auth::attempt(['phone_number' => $phone, 'password' => $password]) )
{
return redirect()->intended('/');
}
else
{
return redirect('/login');
}
}