How to create custom authentication in laravel 8?
PHP Snippet 1:
protected function validateLogin(Request $request)
{
$request->validate([
$this->username() => 'required|string',
'password' => 'required|string',
]);
}
protected function credentials(Request $request)
{
return $request->only($this->username(), 'password');
}
//Mention your username here
public function username()
{
return 'user_name';
}