Here is a working, although not perfect, solution:
In app\Http\Controllers\Auth\LoginController.php
, I have overwritten the authenticated
method, instead of the credentials
method:
protected function authenticated()
{
if (Auth::user()->active !== 1) {
Auth::logout();
return redirect('/login')->withError('Your account is not active!');
}
}
In the login view, above the form:
<div class="alert alert-danger alert-dismissible">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<p class="my-0 text-center">{{ session('error') }}</p>
</div>
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community