added redirect::back method.
This commit is contained in:
parent
364c39dad2
commit
55669ee0ae
|
|
@ -14,6 +14,17 @@ public static function home($status = 302, $https = false)
|
||||||
return static::to(URL::home($https), $status);
|
return static::to(URL::home($https), $status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a redirect response to the HTTP referrer.
|
||||||
|
*
|
||||||
|
* @param int $status
|
||||||
|
* @return Redirect
|
||||||
|
*/
|
||||||
|
public static function back($status = 302)
|
||||||
|
{
|
||||||
|
return static::to(Request::referrer(), $status);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a redirect response.
|
* Create a redirect response.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,16 @@ public static function ajax()
|
||||||
return strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';
|
return strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the HTTP referrer for the request.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function referrer()
|
||||||
|
{
|
||||||
|
return array_get($_SERVER, 'HTTP_REFERER');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if the current request is via the command line.
|
* Determine if the current request is via the command line.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue