Support the ongoing development of Laravel.io →
posted 8 years ago
Authentication
Last updated 2 years ago.
0

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']);
0

tdhsmith said:

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']);

Thank you for your response, but could you please more specific. Where should I put such logic?

0

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...

0

Sign in to participate in this thread!

Eventy

Your banner here too?

4unkur 4unkur Joined 15 Aug 2015

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.