From a86d4477ca01ba45cc704213bced78b9b7ddb796 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 7 Jul 2011 23:55:27 -0500 Subject: [PATCH] refactoring redirect class. --- system/redirect.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/system/redirect.php b/system/redirect.php index ea3059bc..9c5ada19 100644 --- a/system/redirect.php +++ b/system/redirect.php @@ -34,8 +34,8 @@ class Redirect { $url = URL::to($url, $https); return ($method == 'refresh') - ? new static(Response::make('', $status)->header('Refresh', '0;url='.$url)) - : new static(Response::make('', $status)->header('Location', $url)); + ? new static(Response::make('', $status)->header('Refresh', '0;url='.$url)) + : new static(Response::make('', $status)->header('Location', $url)); } /** @@ -60,11 +60,13 @@ class Redirect { */ public function with($key, $value) { - if (Config::get('session.driver') != '') + if (Config::get('session.driver') == '') { - Session::flash($key, $value); + throw new \Exception("Attempting to flash data to the session, but no session driver has been specified."); } + Session::flash($key, $value); + return $this; }