@error directive is not displaying errors in laravel view

前端 未结 2 1246
时光说笑
时光说笑 2021-01-27 05:33

I\'m working on custom Laravel login implementation. I have returned the error from controller as follows:

$credentials = $request->only(\'email\', \'password         


        
2条回答
  •  北海茫月
    2021-01-27 06:21

    Please try it again:

    $credentials = $request->only('email', 'password');
    if (Auth::attempt($credentials)) {
      // Authentication passed...
      return redirect()->intended('surveys');
    }else {
      return redirect()->back()->withErrors(['email' => 'The Message']);
    }
    

提交回复
热议问题