Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indentno/detect-user-agent
Detects the user agent of the browser
https://github.com/indentno/detect-user-agent
Last synced: about 2 months ago
JSON representation
Detects the user agent of the browser
- Host: GitHub
- URL: https://github.com/indentno/detect-user-agent
- Owner: indentno
- License: mit
- Created: 2017-08-28T09:09:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-28T09:10:29.000Z (over 7 years ago)
- Last Synced: 2024-09-18T13:50:01.370Z (4 months ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Detect User Agent
[![Packagist](https://img.shields.io/packagist/dt/sempro/detect-user-agent.svg?style=flat-square)](https://packagist.org/packages/sempro/detect-user-agent)
[![Packagist](https://img.shields.io/packagist/v/sempro/detect-user-agent.svg?style=flat-square)](https://packagist.org/packages/sempro/detect-user-agent)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)Detects what user agent the browser is using.
## Installation
You can install the package via composer:
```bash
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.
```php
...
Sempro\DetectUserAgent\Providers\DetectUserAgentServiceProvider::class,
...
```## Usage
```php
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
- [Runar Jørgensen](https://github.com/ventrec)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.