diff --git a/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php b/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php index c5a4802a7744..dcf241d95da6 100644 --- a/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php +++ b/src/Illuminate/Foundation/Auth/AuthenticatesUsers.php @@ -144,7 +144,7 @@ public function username() /** * Log the user out of the application. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function logout(Request $request) @@ -155,7 +155,7 @@ public function logout(Request $request) $request->session()->regenerate(); - return redirect('/'); + return redirect($this->redirectAfterLogoutPath()); } /** diff --git a/src/Illuminate/Foundation/Auth/RedirectsUsers.php b/src/Illuminate/Foundation/Auth/RedirectsUsers.php index c86d9d96a662..3aa6d60e1a2b 100644 --- a/src/Illuminate/Foundation/Auth/RedirectsUsers.php +++ b/src/Illuminate/Foundation/Auth/RedirectsUsers.php @@ -13,4 +13,14 @@ public function redirectPath() { return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home'; } + + /** + * Get the post logout redirect path. + * + * @return string + */ + public function redirectAfterLogoutPath() + { + return property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/'; + } }