ubxty / ubx-ua-parser
Comprehensive User Agent parser for Laravel applications
Installs: 60
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ubxty/ubx-ua-parser
Requires
- php: ^7.3|^8.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0|^12.0
- jenssegers/agent: ^2.6
README
A comprehensive User Agent parser for Laravel applications.
Installation
composer require ubxty/ubx-ua-parser
Usage
use Ubxty\UAParser\Facades\UAParser; // Get platform $platform = UAParser::getPlatform(); // android, ios, web, etc. // Get browser $browser = UAParser::getBrowser(); // chrome, firefox, in-app, etc. // Detect bots $isBot = UAParser::isBot(); // Get original UA string $ua = UAParser::getOriginalUserAgent(); // Get device type $device = UAParser::getDeviceType(); // phone, tablet, desktop, etc.
Configuration
Publish the config file:
php artisan vendor:publish --provider="Ubxty\UAParser\UAParserServiceProvider" --tag="config"
Methods
- getPlatform(): string
- getBrowser(): string
- isBot(): bool
- getOriginalUserAgent(): ?string
- getDeviceType(): string
- getBrowserVersion(): string
- getPlatformVersion(): string
License
MIT