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

Laravel Device Detector Laravel Package

reefki/laravel-device-detector

Laravel integration for device detection that parses user agents to identify device type (mobile, tablet, desktop), OS, browser, and bots. Access results in Blade views, middleware, or anywhere in your app to serve tailored content, redirect traffic, and improve analytics.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Responsive vs. adaptive delivery. Gives the backend a per-request verdict on device type (mobile/tablet/desktop), brand, model, OS, and browser — the input you need to decide whether to serve a lightweight view, a different template, or a reduced payload. That is a roadmap-level question ("do we invest in a mobile web experience or a native app?") answered with data from the same code path.
  • Device-mix roadmap prioritization. Enriching requests, signups, or conversions with device metadata lets you segment funnels by device class without buying a separate analytics product. Cheap way to answer "are our tablet users churning?" before committing engineering time.
  • Build vs. buy on user-agent parsing. User-agent parsing is a notorious long tail of regexes that decays monthly. This package lets you buy (well, MIT-license) that maintenance rather than own it — the build option is almost never justified for a product team.
  • Bot and crawler filtering. Bot detection is the same API call, which serves several unrelated decisions at once: cleaning analytics, gating promo redemption, rate-limiting scrapers, and preventing inflated signup metrics from feeding into roadmap decisions.
  • Personalization and feature gating. Device-class gating for features that genuinely don't work everywhere (heavy WebGL, camera upload, push notifications), and A/B test bucketing that respects platform differences instead of confounding results.
  • Content and commerce decisions. Brand/model detection supports device-specific asset sizing, OS-specific install instructions, and merchandising decisions ("which phone models drive our highest AOV?").
  • Log and support triage. Enriching server logs with parsed device data shortens support debugging and makes "is this bug iOS-only?" a query rather than a hunch.

When to Consider This Package

Consider it when:

  • You are already on Laravel and want device awareness in the backend, where the decision is actually made (which template, which payload, which feature flag).
  • You need the richer signal — brand, model, bot classification — that mobiledetect-style libraries don't provide.
  • You want zero vendor cost and no external API call in the request path; MIT license and local computation means no procurement, no DPA, no per-request billing.
  • You're doing server-side analytics enrichment or log processing, where a client-side JS snippet can't help.
  • You want an afternoon-sized integration, not a project: the value is realized in days, not sprints.

Look elsewhere — or just install matomo/device-detector directly — when:

  • You need vendor confidence. 31 stars and 0 dependents is effectively zero community validation. This is a thin convenience wrapper around a well-maintained library, so the underlying tech is safe, but the wrapper itself is a single-maintainer artifact. Budget for the possibility that you fork or vendor it.
  • You need client-side decisions. If the question is "which layout do I render in the SPA?", do it in the browser; don't round-trip a UA parse.
  • Latency is the binding constraint. UA parsing is not free. At high request volume, you must memoize per request or cache by UA string — plan for that before adopting.
  • Accuracy on modern clients is critical. UA strings are increasingly frozen and reduced; the underlying library leans on Client Hints for accuracy, which requires you to accept and forward those headers. If you can't change your header handling, expect degraded detection.
  • You want a supported dependency with SLAs. There's none here. Acceptable for an internal utility with a clean exit ramp; not acceptable as load-bearing infrastructure for a paid product.
  • A CDN or edge already gives you this. Cloudflare, Fastly, and most WAFs hand you device class as a header for free.
  • You're not on Laravel. Use the base library; the wrapper's only value is service-provider and facade ergonomics.

How to Pitch It (Stakeholders)

For executives — one paragraph: Device detection is a small, low-cost capability that unlocks several decisions we're currently making on assumption: whether to invest in mobile web, where our conversion funnel leaks by device, and how much of our traffic is bots inflating our metrics. This package is MIT-licensed and wraps Matomo's proven Universal Device Detection library, so we're reusing code that already runs at scale rather than building our own. Integration is measured in days, not sprints, and there is no vendor contract, no per-request fee, and no data leaving our infrastructure. The main caveat is that the wrapper itself is a low-adoption open-source project, which is a manageable risk precisely because it is a thin layer — if it stalls, we swap in the base library with a one-file change. Recommendation: adopt for internal enrichment and device-aware delivery, treat it as a utility rather than a platform dependency, and revisit only if it becomes load-bearing.

For engineering — the short version: It's a service provider and facade over matomo/device-detector. You get a parsed result object (device type, brand, model, OS, browser, bot flag) from the request's User-Agent. Costs: one composer dependency, a request-scoped parse (memoize it — don't parse twice), and header handling if you want Client Hints accuracy. The code surface is small enough to audit in an hour, which you should do, because the maintenance risk sits in the wrapper, not the parser. Keep the integration behind a small internal interface so replacing it is mechanical.

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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast