Weave Code
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

Device Detector Laravel Package

matomo/device-detector

Parses User-Agent strings and browser Client Hints to identify device type (desktop/tablet/mobile/TV/console), client apps (browsers, media players, feed readers), operating systems, and device brand/model. Composer-ready PHP library.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Personalization & A/B Testing: Enable device-specific UI/UX optimizations (e.g., mobile vs. desktop layouts) or feature flags (e.g., hide desktop-only features on mobile).
  • Analytics & Segmentation: Power granular user segmentation in dashboards (e.g., "iOS users," "Android tablets," "Smart TVs") for targeted marketing or support.
  • Bot Mitigation: Identify and block scrapers/crawlers (e.g., isBot()) to reduce API abuse or fake traffic in analytics.
  • Progressive Enhancement: Serve lightweight experiences to low-end devices (e.g., feature phones) while enabling advanced features for high-end devices.
  • Compliance & Accessibility: Detect assistive technologies (e.g., screen readers) or legacy devices to ensure WCAG compliance or graceful degradation.
  • Roadmap Prioritization:
    • Build vs. Buy: Avoid reinventing a user-agent parser (maintenance burden) when this package offers 90%+ coverage of devices/browsers with minimal effort.
    • Monetization: Enable device-based pricing (e.g., premium features for desktop users) or ads tailored to device capabilities.
  • Use Cases:
    • E-commerce: Redirect mobile users to optimized checkout flows or highlight touch-friendly features.
    • Media Streaming: Serve HLS for iOS or WebM for Android to reduce buffering.
    • Gaming: Detect consoles (e.g., isConsole()) to offer controller support or optimize graphics settings.

When to Consider This Package

  • Avoid if:
    • Your stack doesn’t use PHP/Laravel (e.g., Node.js, Python, or Java). Use language-specific ports (e.g., device-detector-js).
    • You need real-time device fingerprinting (beyond User-Agent/Client Hints). Consider commercial tools like 51Degrees or WURFL.
    • Your traffic is >99% desktop with minimal mobile/edge devices. Overkill for simple projects.
    • You require custom device detection (e.g., proprietary hardware). Extend the YAML rules or build a custom parser.
  • Look elsewhere if:
    • You need machine learning-based detection (e.g., behavioral patterns). This is rule-based (regex/YAML).
    • Your budget allows for SaaS solutions (e.g., DeviceAtlas) with cloud updates.
    • You’re constrained by LGPL-3.0 license (e.g., proprietary software). Check compliance risks.

How to Pitch It (Stakeholders)

For Executives:

*"This open-source PHP package lets us automatically detect and adapt to any user’s device—from smartphones to smart TVs—with 90%+ accuracy. It’s used by Matomo (3M+ installs) and enables:

  • Higher conversion rates by serving optimized experiences (e.g., mobile checkout flows).
  • Cost savings by avoiding custom parsing logic (no dev time, no maintenance).
  • Scalable personalization for ads, support, or features without manual segmentation. It’s free, lightweight, and integrates seamlessly with our Laravel stack. Competitors like 51Degrees charge $10K+/year for similar capabilities."*

For Engineering:

*"Pros:

  • Battle-tested: Used in Matomo (3M+ users), with 3.5K GitHub stars and active maintenance (last release: May 2026).
  • Performance: Supports caching (Redis, APCu, PSR-6) to avoid redundant parsing.
  • Extensible: Customize YAML rules or add PSR-6 cache bridges.
  • Lightweight: ~1MB package, no external dependencies (except optional YAML parser).

Cons:

  • No active ML: Relies on regex/YAML (but updates are frequent).
  • LGPL-3.0: Ensure compliance if embedding in proprietary software.

Integration:

// 5 minutes to add to Laravel:
composer require matomo/device-detector
$dd = new DeviceDetector($_SERVER['HTTP_USER_AGENT']);
$dd->parse();
if ($dd->isMobile()) { /* ... */ }

Use Cases:

  1. Feature Flags: Hide desktop-only features on mobile.
  2. Analytics: Segment users by isSmartTV() or isWearable().
  3. Bot Blocking: Reject scrapers with $dd->isBot()."*
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi