diff --git a/src/Illuminate/Http/RedirectResponse.php b/src/Illuminate/Http/RedirectResponse.php index 0c71743dd62f..37093e94ea50 100755 --- a/src/Illuminate/Http/RedirectResponse.php +++ b/src/Illuminate/Http/RedirectResponse.php @@ -131,9 +131,14 @@ public function exceptInput() public function withErrors($provider, $key = 'default') { $value = $this->parseErrors($provider); + $errors = $this->session->get('errors', new ViewErrorBag); + + if (! ($errors instanceof ViewErrorBag)) { + $errors = new ViewErrorBag; + } $this->session->flash( - 'errors', $this->session->get('errors', new ViewErrorBag)->put($key, $value) + 'errors', $errors->put($key, $value) ); return $this;