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

Phpuseragentparser Laravel Package

donatj/phpuseragentparser

A tiny, fast PHP user-agent parser that detects all modern browsers with just three regular expressions and under 200 lines of code. Installable via Composer, fully unit tested, and easy to use.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Traffic segmentation and analytics enrichment. Tag sessions by browser, platform, and browser version to answer "which surfaces do our users actually browse from?" without standing up a device-intelligence service. This informs responsive-design investment, browser-support matrices, and QA coverage priorities.
  • Bot and AI-crawler visibility. The package explicitly detects search bots (Googlebot, Bingbot, Applebot, YandexBot), social bots (Slackbot, Twitterbot, TelegramBot, iMessageBot, facebookexternalhit), and — notably in recent releases — AI crawlers (GPTBot, OAI-SearchBot, ChatGPT-User). This supports decisions on whether to log, throttle, allow, or serve differentiated content to AI crawlers — a live 2024–2026 content-strategy question for any content or commerce product.
  • Bot/human traffic filtering. Cheap pre-filter for analytics pipelines and rate-limit/abuse heuristics. Useful as one signal among many, not as a security control.
  • Feature gating and graceful degradation messaging. Browser + version lets you decide when to show "your browser is unsupported" banners or suppress features known to break on older Edge/IE/UC Browser.
  • Build-vs-buy on observability primitives. At sub-200 lines and three regexes, this is a "don't build it" call — adopt the library, spend the saved engineering time on the decisions the data feeds.
  • Roadmap input for platform support. Aggregate browser/platform distribution directly informs which devices and browsers appear on the supported-platforms roadmap.

When to Consider This Package

Adopt when:

  • You are on PHP/Laravel and want browser, platform, and browser-version extraction with zero infrastructure, zero external calls, and a trivially small dependency footprint.
  • Your needs are coarse: "is this a mobile platform?", "is this a bot?", "which browser family?" — not device-level precision.
  • Bot-vs-human classification matters to your product (SEO monitoring, AI-crawler governance, analytics hygiene).
  • You value maintenance signals: MIT license, 100% unit test coverage, active releases (v1.9.0 added ChatGPT and Mastodon support), and a stable 1.x API with a non-breaking upgrade path from 0.x.
  • You want predictable behavior you can read and audit in an afternoon.

Look elsewhere when:

  • You need OS version, device model, hardware capability, or screen size. The maintainer explicitly declines this scope — UA strings are unreliable for OS versions anyway, and the recommended path is client-side JavaScript.
  • You need to distinguish Brave from Chrome or iPadOS 13+ from macOS — both are undetectable by design, not by omission.
  • You need high-accuracy device intelligence or fingerprinting for fraud, pricing, or content rights. That is a commercial category (DeviceAtlas, 51Degrees, WURFL), not a regex library.
  • You require vendor SLAs or indemnification. MIT + single maintainer means community support only.
  • Your stack isn't PHP — the value is entirely in the drop-in Composer ergonomics.

How to Pitch It (Stakeholders)

To executives: This is a small, free, MIT-licensed utility that turns raw browser strings into clean, structured signals — browser, platform, version, and bot identity. It lets us report on how customers actually reach us, spot AI and search crawlers in our traffic, and make evidence-based calls on browser support and content-access policy for bots. Cost is effectively nil; the maintenance risk is low and the license is permissive.

To engineering: One Composer dependency, PHP ≥5.4, ext-ctype, no network calls, no config. Under 200 lines and three regexes, with 100% unit test coverage and a namespaced API (\donatj\UserAgent\parse_user_agent()) plus an OO wrapper (UserAgentParser). Active releases, clean 1.x semver, and recent additions cover AI crawlers (GPTBot, OAI-SearchBot, ChatGPT-User) and modern browsers. The important caveat is scope: it deliberately does not parse OS versions and cannot separate Brave from Chrome or iPadOS 13+ from macOS — do not expect device intelligence from it. Treat it as a fast, readable classifier, not a browser knowledge engine.

Recommendation: Adopt for browser/platform/bot classification in analytics and traffic-policy paths. Pair with client-side detection if OS-version or device-level accuracy ever becomes a requirement, and revisit only if we need commercial-grade device intelligence or fingerprinting.

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.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels