You've put your
if
statement inside of the
$request->validate
code rather than outside. According to the Laravel documentation you should instead be using the return value of the method:
$validateLogin = $request->validate([ .. ]);
if ($validateLogin->fails()) {
..
}