refactoring redirect class.
This commit is contained in:
parent
ea6b58b28c
commit
a86d4477ca
|
@ -34,8 +34,8 @@ public static function to($url, $method = 'location', $status = 302, $https = fa
|
|||
$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 @@ public static function to_secure($url, $method = 'location', $status = 302)
|
|||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue