crossknowledge/devicedetect-bundle
Symfony bundle that integrates device detection into your application, identifying mobile, tablet, desktop, and other client types from the user agent. Provides configurable services for adapting responses, routing, and templates to the detected device.
update twig to 2 | 3.28, PR #14). No API, service definition, or detection-logic changes. This is a compatibility-maintenance release, not a functional one.composer.json inspection says otherwise.matomo/device-detector, and demonstrates the intended detection + template-helper pattern we would reproduce with a Laravel service provider and Blade directive.^2.0 || ^3.28, PHP 8.1+ (verify — release notes disclose only the Twig change, so PHP/Symfony constraints must be read from composer.json rather than inferred).3.28 lower bound is a recent Twig release. Any Symfony consumer pinned below Twig 3.28 (or on Twig 1.x) must upgrade Twig before or alongside this bump. For Laravel, this constraint is inert.composer require matomo/device-detector is PHP 8.1–8.4 compatible, has no framework coupling, and requires no schema or external service. Only the Symfony bundle wrapper is unusable.crossknowledge/devicedetect-bundle into Laravel applications; it would drag in symfony/* and twig/* constraints and create resolution conflicts with Laravel's own dependency tree.matomo/device-detector directly.composer.json in 6.2.0 also raise PHP or Symfony floors? Release notes omit this; verify before asserting PHP 8.4 / Symfony 7 support.matomo/device-detector, versus jenssegers/agent (which wraps the same detector and is Laravel-native). Prefer the thinner dependency if we only need one or two signals.matomo/device-detector via a singleton binding in a service provider plus a thin Blade directive (@device('mobile')) or a DeviceService. This is the primary path for our estate.composer require crossknowledge/devicedetect-bundle:^6.2 with Twig ≥3.28.composer require matomo/device-detectorDeviceDetector (or a wrapper service) as a scoped singleton; parse once per request, memoize the result object.^6.2, ensure Twig ^3.28, run composer update crossknowledge/devicedetect-bundle twig/twig --with-dependencies.composer.json — the notes do not state a PHP change.^2.0 || ^3.28. Twig 1.x is out. This is the single compatibility gate introduced by 6.2.0.composer.json.composer.json and CHANGELOG of 6.2.0; diff 6.1.0 → 6.2.0 to confirm the Twig-only delta; inventory Twig versions across Symfony services.jenssegers/agent for each consuming application.matomo/device-detector upgrades and UA-corpus regression tests. The bundle maintainers will not absorb this for us.^6.2 for Symfony consumers; pin the detector library to a minor range in Laravel and upgrade deliberately, since signature changes shift classification results.@device('mobile') means, fallback behavior, cache key) so support engineers can answer "why was this user classified as X" without reading vendor code.User-Agent alongside the classification for a sampled percentage of traffic; retain for 30 days.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Twig <3.28 in a Symfony consumer | Composer resolution failure on upgrade to 6.2.0 | Upgrade Twig first; treat as a planned dependency task, not an incident. |
| Bundle activity stops entirely | No constraint updates for new Symfony majors | Low impact — we depend on matomo/device-detector directly in Laravel; Symfony consumers reassess at next major. |
| Stale device signatures | Misclassification of new devices/bots | Scheduled library upgrades; track classification drift on a sampled UA corpus. |
| UA spoofing / bots | Incorrect gating decisions, potential abuse | Combine with IP heuristics, headers (Sec-CH-UA), and rate limiting; never use detection for security decisions. |
| Cache stampede after deploy | Latency spike | Warm cache, jitter TTLs, single-flight locking. |
| Detection service exception | Request failure if unguarded | Fail-open to a default device profile; never let classification block rendering. |
How can I help you explore Laravel packages today?