diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index 10240934ed23..ef2c9af0c988 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -157,11 +157,12 @@ function auth($guard = null) * * @param int $status * @param array $headers + * @param string $fallback * @return \Illuminate\Http\RedirectResponse */ - function back($status = 302, $headers = []) + function back($status = 302, $headers = [], $fallback = false) { - return app('redirect')->back($status, $headers); + return app('redirect')->back($status, $headers, $fallback); } } diff --git a/src/Illuminate/Routing/Redirector.php b/src/Illuminate/Routing/Redirector.php index 68b8c4ec8312..56fe8bd9f5a2 100755 --- a/src/Illuminate/Routing/Redirector.php +++ b/src/Illuminate/Routing/Redirector.php @@ -48,11 +48,12 @@ public function home($status = 302) * * @param int $status * @param array $headers + * @param string $fallback * @return \Illuminate\Http\RedirectResponse */ - public function back($status = 302, $headers = []) + public function back($status = 302, $headers = [], $fallback = false) { - $back = $this->generator->previous(); + $back = $this->generator->previous($fallback); return $this->createRedirect($back, $status, $headers); }