Skip to content

Commit

Permalink
Request helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Feb 12, 2015
1 parent fdf423c commit 78bb47b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}
}

0 comments on commit 78bb47b

Please sign in to comment.