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.
thomastkim said:
So you don't want them to login at all if they are not confirmed?
Yes, exactly.
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;
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community