Download the PHP package karmendra/laravel-agent-detector without Composer
On this page you can find all versions of the php package karmendra/laravel-agent-detector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download karmendra/laravel-agent-detector
More information about karmendra/laravel-agent-detector
Files in karmendra/laravel-agent-detector
Package laravel-agent-detector
Short Description Laravel wrapper for matomo-org/device-detector user agent parser
License MIT
Homepage https://github.com/karmendra/laravel-agent-detector
Informations about the package laravel-agent-detector
Laravel Agent Detector
A PHP desktop/mobile user agent parser for Laravel, based on Device Detector that will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.
Goto http://devicedetector.net for a quick demo of what this library can detect.
Installation
Install using composer:
Laravel (optional)
Add the service provider in config/app.php
:
And add the AgentDetector alias to config/app.php
:
Basic Usage
Start by creating an AgentDetector
instance (or use the AgentDetector
Facade):
If you want set different user agents on the fly in CLI scripts for example, you can use the setUserAgent
All of the original Device Detector methods are still available
Additional Functionality
Device type
Get the device type. (smartphone
, mobile
, tablet
, desktop
, bot
...)
Device brand name
Get the device manufactures brand name, if mobile. (Apple
, Nexus
, Samsung
, ...)
Device model
Get the device model, if mobile. (Apple: iPhone
, Samsung: Galaxy S9
...)
Platform / Operating system name
Get the operating system. (Ubuntu
, Android
, Windows
, Mac
, iOS
, ...)
Platform version (OS version).
Get the platform version. (Windows: 10
, Mac: 10.11
, Android: 9.0
, ...)
Browser name
Get the browser name. (Chrome
, IE
, Safari
, UC Browser
, ...)
Browser version
Get the browser name. (Chrome: 56
, Safari: 9.0
, Firefox: 48
, ...)
Robot detection
Check if the user is a robot. (true
or false
)
To-do (PR welcome):
- Adding test cases
- Adding additional functions for getting robot info, enable disable robot detection etc.
License
Laravel Agent Detector is licensed under The MIT License (MIT).