sempro/detect-user-agent

Detects which user agent is being used by the current browser

Installs: 2 594

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 0

Type:package

1.0 2017-08-28 09:08 UTC

This package is auto-updated.

Last update: 2024-12-11 17:25:42 UTC


README

Packagist Packagist PRs Welcome

Detects what user agent the browser is using.

Installation

You can install the package via composer:

composer require sempro/detect-user-agent

If you are using a version below 5.5 of laravel, then you will also have to add the service provider to the app.php config file.

...
Sempro\DetectUserAgent\Providers\DetectUserAgentServiceProvider::class,
...

Usage

use Sempro\DetectUserAgent\Contracts\DetectUserAgent;

...

public function index(DetectUserAgent $userAgent)
{
    return $userAgent->isMobile();
}

See source file for an overview of what methods are available.

Credits

License

The MIT License (MIT). Please see License File for more information.