php - Laravel Authentication Custom Rule -


i'm working laravel auth. trying add new rule email , password, if status(field in user model) = 1 cannot login. cannot find should add this. looking @ middleware, guard.php authenticateusers.php did not found it..


edit:

i've solved creating new middleware checks field. can done auth::attempt

you can try as:

if (auth::attempt(['email' => $email, 'password' => $password, 'status' => 1])) {     // user active, not suspended, , exists. } 

from docs

if wish, may add conditions authentication query in addition user's e-mail , password.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -