C
C
Cavin March2017-01-21 14:19:37
Laravel
Cavin March, 2017-01-21 14:19:37

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

1 answer(s)
C
Cavin March, 2017-01-22
@ForbsmC

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();
}

Framework version 5.2.16

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question