matomo/device-detector
Universal device detection library that parses User Agents and Browser Client Hints to identify devices (desktop, tablet, mobile, TV, console), browsers and other clients, operating systems, brands, and models.
Architecture fit
DeviceDetector with a UA string plus optional ClientHints, call parse(), read normalized accessors (isBot(), getClient(), getOs(), getDeviceName(), getBrandName(), getModel()). It is a pure in-process dependency with no service, no network hop, and no schema of its own — it slots cleanly underneath any Laravel service layer without dictating architecture.new DeviceDetector(...) leak across controllers and jobs.Integration feasibility
DeviceDetector\Yaml\Symfony the pragmatic choice.DeviceDetector\Cache\LaravelCache bridge exists, plus PSR-6/PSR-16/Doctrine bridges — this is the single most important integration lever, since the default cache is per-process only and therefore near-useless under PHP-FPM.Technical risk
Accept-CH/Permissions-Policy — meaning hints arrive only from the second request onward. Any feature that hard-depends on exact model/brand will be partially wrong in production; treat output as a probability signal, not identity.matomo-org/device-detector repository, stars are blank, and "Dependents: 0" contradicts the Packagist download volume. This is almost certainly ingestion error, not a real signal — but confirm the canonical repo and release tags before locking a version policy. The 9.6 score with a 55.25 opportunity score reads as "low-risk utility, not a differentiator" — consistent with the assessment above.Key questions
isBot(), isMobile(), coarse device type) avoids most accuracy and performance risk.Accept-CH and store Client Hints? Without them, modern Safari/Firefox traffic is materially less precise.Stack fit
X.Y, which silently breaks any feature expecting full version comparison.Migration path
jenssegers/agent / mobile-detect (the common Laravel default), plan a parallel-run migration: implement an internal DeviceContext interface, back it with device-detector, and keep the old adapter behind a config flag for one release cycle. Compare outputs on sampled traffic before cutover.array/file in dev and Redis in production without code churn.Compatibility
ClientHints::factory($_SERVER) signature is superglobal-based; in Laravel use $request->server()/header accessors instead, and add a response middleware to emit Accept-CH so hints populate on subsequent requests. Sequence this before any accuracy-sensitive feature ships.composer update side effect.Sequencing
DeviceContext wrapper + facade, with unit tests over a fixed UA fixture set.Accept-CH response middleware and start capturing hints (cheap, reversible, improves everything downstream).Maintenance
Support
Scaling
Failure modes
Accept-CH.Ramp-up
How can I help you explore Laravel packages today?