northrook / user-agent
PHP Browser detection using the user agent.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/northrook/user-agent
Requires
- php: >=8.1
 - foroco/php-browser-detection: ^2.7
 
Requires (Dev)
- northrook/core: dev-main
 - northrook/dev-env: dev-main
 
This package is auto-updated.
Last update: 2025-10-16 14:47:51 UTC
README
A wrapper for the foroco/php-browser-detection library.
This package offers a simple class parsing the user agent string.
Important
This package is still in development.
While it is considered MVP and stable, it may still undergo breaking changes.
Installation
composer require northrook/user-agent
Usage
The UserAgent class static, and cannot be instantiated.
Access pre-parsed data using these static methods:
use Northrook\UserAgent; // Retrieve the foroco\BrowserDetection object $userAgent = UserAgent::detect() : BrowserDetection // Pass a string to $match the current OS family. // If no $match is passed, a string with the matched OS family is returned $os = UserAgent::OS(); UserAgent::getAll(); UserAgent::getOS(); UserAgent::getBrowser();