php - Laravel Auth Custom Fields -


trying add custom field auth, check if user 'activated' before allowing login

i've tried modifying authenticatesusers.php although understand file shouldnt edited directly.

here tried , did not work.

    public function postlogin(request $request) {     $this->validate($request, [         $this->loginusername() => 'required', 'password' => 'required', 'activated' => '1'     ]); 

you can add custom field manaually authenticating users.

public function postlogin(request $request) {     $this->validate($request, [         $this->loginusername() => 'required', 'password' => 'required'     ]);       if (auth::attempt(['email' => $request->email, 'password' => $request->password,'activated'=>1]) )        {                  return redirect()->intended('/');        } } 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -