这里是我的login.blade.phpLaravel 5.5登录错误没有显示出来
@if(Session::get('errors')||count($errors) > 0)
@foreach ($errors->all() as $error)
<h1>{{ $error }}</h1>
@endforeach
@endif
这里是我的LoginController.php:
protected function sendFailedLoginResponse(Request $request)
{
return redirect()->back()
->withInput($request->only($this->username(), 'remember'))
->withErrors([
$this->username() => 'ERRORS',
]);
}
这里是我的web.php(路线)
// I am customizing the login to do extra checks,
// but I still need the basic auth scaffolding.
Auth::routes();
...
Route::group(['middleware' => 'web'], function() {
Route::view('/login', 'auth.login');
Route::post('/login', 'Auth\[email protected]')->name('login');
});
当我试图用错误的用户它显示视图中没有错误登录,我算什么我做错了?
更新:
我试图改变login.blade.php,作为@Seva卡拉什尼科夫认为,没有运气。
我也试过@Akshay Kulkarni建议没有运气。
它应该是'$ errors-> any()' – Ohgodwhy
下面是来自Laravel Basic Auth Views的示例:https://github.com/drbyte/laravel-basic-auth-views/blob/master/resources/views /auth/login.blade.php –
和[这里是来自documentaion的示例](https://laravel.com/docs/5.5/validation#quick-displaying-the-validation-errors)。它应该是'$ errors-> any()'。查看留言包始终可用。 – Ohgodwhy