Support the ongoing development of →
Authentication Authorization
Last updated by @ajax30 1 year ago.

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) {
    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>

enter image description here


Sign in to participate in this thread!


Your banner here too?

Razvan ajax30 Joined 2 Oct 2021


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.