I'm currently using the Breeze Scaffolding maybe it has a premade LoginController?
It has a LoginRequest.php
public function authenticate()
{
$this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only('email', 'password'), $this->filled('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => __('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
}
maybe I can throw my validation here? like
if(auth()->attempt(array('email' => $inputVal['email'], 'password' => $inputVal['password']))){
if (auth()->user()->is_admin == 1) {
return redirect()->route('admin.route');
}else{
return redirect()->route('home');
}
}else{
return redirect()->route('login')
->with('error','Email & Password are incorrect.');
}
and btw thank you for your response NIMROD :)