From 78bb47bf6e6ba66aaacc715b5482088cdc7969f2 Mon Sep 17 00:00:00 2001 From: Brooke Bryan Date: Thu, 12 Feb 2015 17:07:02 +0000 Subject: [PATCH] Request helpers --- src/Http/Request.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Http/Request.php b/src/Http/Request.php index ae268a4..46f3b7e 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -273,4 +273,31 @@ public function isPrivateNetwork($ip = null) ['192.168.', '10.', '172.16.', '127.'] ); } + + /** + * Retrieve the user agent for the request + * + * @param null $default + * + * @return mixed + */ + public function userAgent($default = null) + { + return $this->server->get('HTTP_USER_AGENT', $default); + } + + /** + * Retrieve the referrer for the request + * + * @param null $default + * + * @return mixed + */ + public function referrer($default = null) + { + return $this->server->get( + 'REFERER', + $this->server->get('HTTP_REFERER', $default) + ); + } }