Commit 7ebcdf57 authored by Taylor Otwell's avatar Taylor Otwell

refactor redirect class.

parent 09feb52d
...@@ -24,12 +24,12 @@ class Redirect { ...@@ -24,12 +24,12 @@ class Redirect {
* Create a redirect response. * Create a redirect response.
* *
* @param string $url * @param string $url
* @param string $method
* @param int $status * @param int $status
* @param string $method
* @param bool $https * @param bool $https
* @return Redirect * @return Redirect
*/ */
public static function to($url, $method = 'location', $status = 302, $https = false) public static function to($url, $status = 302, $method = 'location', $https = false)
{ {
$url = URL::to($url, $https); $url = URL::to($url, $https);
...@@ -42,13 +42,13 @@ class Redirect { ...@@ -42,13 +42,13 @@ class Redirect {
* Create a redirect response to a HTTPS URL. * Create a redirect response to a HTTPS URL.
* *
* @param string $url * @param string $url
* @param string $method
* @param int $status * @param int $status
* @param string $method
* @return Response * @return Response
*/ */
public static function to_secure($url, $method = 'location', $status = 302) public static function to_secure($url, $status = 302, $method = 'location')
{ {
return static::to($url, $method, $status, true); return static::to($url, $status, $method, true);
} }
/** /**
......
...@@ -28,7 +28,7 @@ class URL { ...@@ -28,7 +28,7 @@ class URL {
$base = 'https://'.substr($base, 7); $base = 'https://'.substr($base, 7);
} }
return rtrim($base, '/').'/'.ltrim($url, '/'); return rtrim($base, '/').'/'.trim($url, '/');
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment