Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Browser Detector

Browser Detector Laravel Package

sinergi/browser-detector

Lightweight PHP library for detecting browser, operating system, device, and language from user agent strings. Uses targeted regex rules instead of a bloated UA database, with simple detectors and optional Laravel service provider and facade integration.

View on GitHub
Deep Wiki
Context7

Sinergi Browser Detector is a lightweight PHP library that identifies the browser, operating system, device, and language from a user agent string. It requires no extensions or heavy dependencies, making it easy to drop into any PHP project—including Laravel via the provided service provider and facade.

  • Browser detection with version and family identification
  • OS detection for desktop and mobile platforms
  • Device type recognition (mobile, tablet, desktop)
  • Accept-language parsing for user locale
  • Laravel integration through facade and service provider
Frequently asked questions about Browser Detector
How do I install sinergi/browser-detector in a Laravel app?
Install it with composer require sinergi/browser-detector. On Laravel 10 and 11, register the optional service provider manually rather than assuming package auto-discovery from a 2021 release. After that, resolve the detector from the container, use the facade, or call the framework-agnostic Browser, OS, and Language classes directly.
Does sinergi/browser-detector support Laravel 10 and Laravel 11?
The package ships an optional Laravel bridge with a service provider and facade, so it can be used on Laravel 10 and 11. Because the last release was in 2021, plan to register the provider manually instead of relying on auto-discovery. Also verify the package's composer.json PHP constraint against your target runtime before adopting it.
Is sinergi/browser-detector still maintained?
No. The package is archived, the last release was 2021-09-23, and there is no active maintainer, CVE response path, or regex-table refresh. Security risk is low because the library performs no I/O, network access, or deserialization, but accuracy risk is high as user-agent strings evolve. If you need ongoing updates, compare it with maintained alternatives such as matomo/device-detector.
Which PHP versions does sinergi/browser-detector support?
Check the composer.json PHP constraint against your target version, especially if you run PHP 8.2 or 8.3. Older releases can trigger dynamic-property deprecations that strict error handlers escalate to exceptions. Run the package through your test suite on the exact PHP version you deploy before committing to it.
How accurate is sinergi/browser-detector compared to matomo/device-detector?
The regex corpus is static from 2021, so it will misclassify newer browsers, Chromium derivatives like Brave, Arc, and Edge, and many post-2021 crawlers. Safari UA freezing, Chrome's UA Reduction rollout, and the shift to User-Agent Client Hints have degraded UA sniffing structurally since then. Benchmark both packages against a sample of your real production user agents before choosing one.
Can I use sinergi/browser-detector for bot detection or blocking?
Do not rely on it for bot blocking or security decisions. Its bot list is from 2021 and will miss newer crawlers and headless tooling. Use it only for low-stakes enrichment such as analytics, logging, or support diagnostics, and pair it with a purpose-built bot management solution if blocking is required.
Is sinergi/browser-detector safe to use in production?
From a security standpoint it is low risk: it is pure PHP with zero runtime dependencies and performs no database, network, cache, or queue operations. The dominant production risk is that the package is archived with no maintainer, so regex updates and CVE responses will not arrive. Scope it as an enrichment dependency and avoid using its output for authorization or entitlement decisions.
How do I register the Laravel service provider and facade for sinergi/browser-detector?
Add the package's service provider to the providers array in config/app.php and, if you want the facade, add its alias to the aliases array. Because the release predates current auto-discovery expectations, do this manually on Laravel 10 and 11. After registration, bind the detector behind your own interface so controllers do not call the package statically.
Does sinergi/browser-detector support User-Agent Client Hints?
No. The library parses classic user-agent strings only and does not read User-Agent Client Hints headers. If Client Hints are important for your application, treat them as the primary signal and use UA parsing only as a fallback. That is an architectural change rather than a simple library swap.
What should I use sinergi/browser-detector for in a Laravel application?
Use it for structured log context, analytics and event enrichment, default-locale resolution from Accept-Language, unsupported-browser notices on public funnels, and support-diagnostics payloads. Feed it from $request->userAgent() and $request->header('Accept-Language') inside middleware or a service class. Wrap the result in an immutable value object such as BrowserInfo and never use the output to gate features, pricing, or access.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager