Agent parses the User-Agent header that your browser sends along with all HTTP requests. It uses a list of patterns to detect what browser and devices you are using. For example, my browser it would return the following information:
Browser: Safari 9.0 Platform: OS X 10.11 Device: Macintosh Mobile: no Tablet: no Desktop: yes Bot: no
To get started, simply install the package using composer:
composer require jenssegers/agent
And create an Agent instance:
use Jenssegers\Agent\Agent; $agent = new Agent; $browser = $agent->browser(); $platform = $agent->platform();
For more information about the available methods, check out the project on github.