Commit 3f441037 authored by Taylor Otwell's avatar Taylor Otwell

added redirect::home

parent 14c9d382
<?php namespace Laravel;
<?php namespace Laravel; use Laravel\Routing\Router;
class Redirect extends Response {
/**
* Create a redirect response to application root.
*
* @param int $status
* @param bool $secure
* @return Redirect
*/
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);
}
/**
* Create a redirect response.
*
......
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