added url::home
This commit is contained in:
parent
75280a9fea
commit
188394bae1
|
@ -11,17 +11,7 @@ class Redirect extends Response {
|
|||
*/
|
||||
public static function home($status = 302, $https = false)
|
||||
{
|
||||
$route = Router::find('home');
|
||||
|
||||
// If a route named "home" exists, we'll route to that instead of using
|
||||
// the single slash root URI. THis allows the HTTPS attribute to be
|
||||
// respected instead of being hard-coded in the redirect.
|
||||
if ( ! is_null($route))
|
||||
{
|
||||
return static::to_route('home', $status);
|
||||
}
|
||||
|
||||
return static::to('/', $status, $https);
|
||||
return static::to(URL::home($https), $status);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,27 @@ public static function current()
|
|||
return static::to(URI::current());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL for the application root.
|
||||
*
|
||||
* @param bool $https
|
||||
* @return string
|
||||
*/
|
||||
public static function home($https = false)
|
||||
{
|
||||
$route = Router::find('home');
|
||||
|
||||
// If a route named "home" exists, we'll route to that instead of using
|
||||
// the single slash root URI. THis allows the HTTPS attribute to be
|
||||
// respected instead of being hard-coded in the redirect.
|
||||
if ( ! is_null($route))
|
||||
{
|
||||
return static::to_route('home');
|
||||
}
|
||||
|
||||
return static::to('/', $https);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the base URL of the application.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue