auth 中间件疑问

大家好,我的用户登录登出的路由如下所示:
Route::post('login', array('before' => 'csrf', function()
{
$rules = array(
'email' => 'required|email',
'password' => 'required|min:2'
);
$validator = Validator::make(Input::all(), $rules);
if ($validator->passes())
{
if (Auth::attempt(array(
'email' => Input::get('email'),
'password' => Input::get('password'),)))
{
return Redirect::intended('home');
} else {
return Redirect::to('login')->withInput()->with('message', 'E-mail or password error');
}
} else {
return Redirect::to('login')->withInput()->withErrors($validator);
}
}));

Route::get('logout', ['middleware' => 'auth', function()
{
Auth::logout();
return redirect('/');
}]);

duang,那么问题来了,登入可以正常,登出就一直给我报ErrorException in Route.php line 194:Undefined offset: 1这个错误,网上也很少有这个错误的相关资料。
所以,我就把auth中间件删了,写成这样:
Route::get('logout', function()
{
Auth::logout();
return redirect('/');
});
如此,登录登出就都正常了,请问上面的那种用auth中间件的写法有什么问题???
已邀请:

要回复问题请先登录注册