If you wish to prevent those users from logging in, you can add the check directly to your Auth::attempt call, which can take any additional WHERE constraints you'd like. For example:
Auth::attempt(['email' => $email, 'password' => $password, 'status' => 'active']);
tdhsmith said:
If you wish to prevent those users from logging in, you can add the check directly to your
Auth::attemptcall, which can take any additional WHERE constraints you'd like. For example:Auth::attempt(['email' => $email, 'password' => $password, 'status' => 'active']);
Thank you for your response, but could you please more specific. Where should I put such logic?
When you create your own auth method! Example is here: https://laravel.com/docs/5.1/authentication#authenticating-users In the Auth:attempt line... then route your login form to this controller action...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.