laravel 5重定向到前一頁登錄後。laravel 5重定向到後簽收前一頁
當我手動打一個網址,如果它不是在其redrecting登錄到登錄頁面,但登錄後應該重定向到輸入的網址,但在我的情況下,它將進入主頁。
代碼:
public function index()
{
// Is the user logged in?
if (Auth::check())
{
return Redirect::route('dashboard');
}
// Show the page
return View('auth.login');
}
public function getSignin()
{
// Is the user logged in?
if (Auth::check())
{
return Redirect::route('dashboard');
}
// Show the page
return View('auth.login');
}
或者我應該改變中間件? – user6527
[Laravel可能重複登錄後重定向回原始目的地](http://stackoverflow.com/questions/15389833/laravel-redirect-back-to-original-destination-after-login) – jannej