我在做一個使用Laravel的應用程序,並且正在做一個登錄系統。 在登錄我沒有任何問題,但是在退出瀏覽器獲得一個錯誤Laravel登錄系統
Whoops, looks like something went wrong.
我的登錄功能
public function postSignin() {
if (Auth::attempt(array('email'=>Input::get('email'), 'password'=>Input::get('password')))) {
return Redirect::to('users/dashboard')->with('message', 'You are now logged in!');
} else {
return Redirect::to('users/login')
->with('message', 'Your username/password combination was incorrect')
->withInput();
}
}
我的註銷功能
public function getLogout() {
Auth::logout();
return Redirect::to('users/login')->with('message', 'Your are now logged out!');
}
如果我刪除行Auth::logout();
頁面被重定向,但我不能使用Auth::check()
來驗證用戶是否已登錄。
在發生錯誤Whoops, looks like something went wrong.
之後,如果我刷新頁面,則重定向正確完成。
任何線索是什麼問題?
編輯:
的錯誤僅僅是
你可以發佈具體的錯誤? – lozadaOmr
@lozadaOmr只是編輯了錯誤的圖像。 – Mario
雖然只是看你的代碼,我似乎無法找到任何錯誤。我只是分享我如何做類似的基本'$ credentials = array('username'=> Input :: get('username'),'password'=> Input :: get('password'));'Then做'Auth :: attempt($ credentials);' 老實說,不知道這是否會有所作用 – lozadaOmr