jeudi 3 août 2017

Laravel 5.4 show activation pending message on login form

I am working on Laravel 5.4 project. I love the login provided by Laravel and it works fine with both login or register.

I add below code to Auth/LoginController.php. It allows only activated users (status=1) to successfully login, but not pending users or blocked users (status =0 or something else).

protected function credentials(\Illuminate\Http\Request $request)
{
    return ['email' => $request->{$this->username()}, 'password' => $request->password, 'status' => 1];
}

Anyway, to protect spam I would like to allow only activated users to login. For those whose account are not activated, I would like to show the pending message on the login form. Also, I would like to do the same thing for blocked users.

Could you please advise me how to achieve this?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2vvvzZW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire