mardi 17 novembre 2020

Laravel 5.5 Flash Message not working in blade file after redirect

I want to logout if user is_active == 0 on login function My Code

LoginController.php

protected function authenticated(Request $request, $user)
{
    if($user->is_active == 0){
        Auth::logout();
        return redirect('/')->with(['errorMessage' => 'Your account is temporary blocked']);
    }
}

View Code:

@if(session('errorMessage'))
    <span class="alert alert-danger">
        
    </span>
@endif


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire