Support the ongoing development of Laravel.io →
Security Requests Input

So I want to add a new condition for registered users to be allowed to login. In the database, there is a 'confirmed' field which is a bool... but I'm not sure how to implement it into the login functionality.

What have I tried: Nothing because I am not sure where to start.

Please note that I do not want to create a new login method, but just add this condition to the current method.

Last updated 3 years ago.
0

So you don't want them to login at all if they are not confirmed?

0

thomastkim said:

So you don't want them to login at all if they are not confirmed?

Yes, exactly.

0

How are you verifying them now? Can you post your code?

For example, if you have something like this in your controller:

$credentials = $request->only('email', 'password');

You can edit it like this to add an extra column to check.

$credentials = $request->only('email', 'password');
$credentials['confirmed'] = 1;
Last updated 9 years ago.
0

thomastkim said:

How are you verifying them now? Can you post your code?

For example, if you have something like this in your controller:

$credentials = $request->only('email', 'password');

You can edit it like this to add an extra column to check.

$credentials = $request->only('email', 'password');
$credentials['confirmed'] = 1;

That worked perfectly! Thank you! Is there any way to make a specific error message for this or no? If there isn't, I'm perfectly okay with it

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.

© 2025 Laravel.io - All rights reserved.