Laravel Validation login

Viewed 22080

This time I'm learning validation. I can't do this for my login form... My code looks like this right now, It works only when I have errors, but this code don't want to login my user. What should be in my code to work and why It doesn't work now? I don't know too how this validate know which email and password should compare to login and from which table? Should I add this info somewhere?

public function login(Request $request)
  {
    $this->validate($request, [
        'email'           => 'required|max:255|email',
        'password'           => 'required|confirmed',
    ]);

        return redirect()->intended('/panel');

  }
1 Answers
Related