Jens Segers on Oct 17 2015

Getting device information from your visitors

Mobiledetect is awesome, but it doesn't extract information for desktop devices and browser. So I decided to create my own package that extends Mobiledetect; meet the Agent.


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.


Sherry Wootten 1 month ago

Hello there

You want quality traffic that Buys From Your Site or Converts into Highly Responsive Subscribers ?

I Will Promote Your Business In Worldwide To Any Niche ...

  • I search in google after the keyward offered by you in order to find sites;
  • I will ask the site administrator if he is interested in your offer;
  • The process continues on many sites until you get all the vizits promises.

    I can send your offer on:

  • Country Desired (only the country you specify)
  • 80% TIER 1 Countries Guaranteed (USA, CA, GB, AU, NZ, IE)
  • Niche Desired(only the keywords you specify)

We help you grow your business because we understand that our business growth directly depends on our ability to GROW YOUR BUSINESS.

Please follow here for more information:

Regards, AxyyKo

Ahmad Saleem 1 year ago

good job