Answer the question
In order to leave comments, you need to log in
How to check the presence of values in the database during authorization in Laravel?
Hello. I am making a website for a game project on Laravel, user registration takes place on the server. But at the same time, when authorizing on the server, it only asks for a password. Now, when a person has registered on the server, logs in with his nickname and password on the site, I need to make a request to the database and see if the first / last name, e-mail fields are filled, check the active field. And if they are not filled, you need to display a form for him. How to implement it, where to dig, tell me please.
Answer the question
In order to leave comments, you need to log in
In general .. After long days of torment, a solution was found. We follow the App/Http/Middlware/Authenticate path, and add our own condition to the handle function. For example, we make a request to the database, and we make a condition. For example:
if ($user->active != '1') {
exit();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question