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

Browser Detector Laravel Package

sinergi/browser-detector

Lightweight PHP library for detecting browser, operating system, device, and language from user agent strings. Uses targeted regex rules instead of a bloated UA database, with simple detectors and optional Laravel service provider and facade integration.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Unchanged. Pure PHP, zero runtime dependencies (no DB, no network, no cache, no queue). It is a leaf utility, so it slots into a Laravel app without touching the domain layer or the request lifecycle contract.
  • The package ships an optional Laravel bridge (service provider + facade) alongside the framework-agnostic Browser, OS, and Language detector classes. The "Laravel-native" path exists, but the core value is the regex tables, not the integration glue.
  • Consumption surface remains tiny and stateless: parse a user-agent string, return browser name/version, OS name/version, and preferred language. That is exactly the shape of an enrichment dependency, and it should be scoped that way — middleware, log context, analytics payloads — never as an authorization or entitlement input.
  • New in 6.1.4: the release only extends the browser regex table (Chromium-based Edge detection). No new public API, no new classes, no configuration surface added. Architectural shape is identical to what was assessed.

Integration feasibility

  • Installation is still a single composer require sinergi/browser-detector, followed by manual provider registration on Laravel 10/11 (do not assume package auto-discovery). 6.1.4 is a patch bump within the same major/minor line, so it is a drop-in upgrade for anyone already on ^6.1 — no code changes, no adapter changes, no migration.
  • Realistic effort to production-grade integration is unchanged at roughly 2–3 days (adapter, container binding, config flag, unit tests, middleware).
  • The real work is still not wiring; it is deciding where the output is allowed to influence behavior. Detection results should land in an immutable value object (BrowserInfo) that can be logged, cached, and asserted against.

Technical risk

  • Archived status: revised, not resolved. The prior "last release 2021-09-23, no maintainer, no CVE response path" framing is now factually stale. 6.1.4 is a merged community contribution (#98, #94) from an outside contributor, which is evidence that upstream is not sealed. It is not evidence of a maintenance commitment: one pattern addition after a multi-year gap tells us a maintainer can merge a PR, not that there is a cadence, a security process, a release policy, or a roadmap. Reclassify from "archived/dead" to "low-activity, community-patched" — the risk premium drops, but the exit path stays.
  • Accuracy risk: reduced at one specific point, structurally unchanged overall. Edge-on-Chromium was one of the named derivative-browser misclassifications in the prior assessment, and this release addresses it directly. That is material for anyone whose analytics or unsupported-browser notices have been folding Edge into the Chrome bucket.
  • The remaining accuracy gaps are untouched: no evidence of Brave/Arc discrimination, no User-Agent Client Hints support, no bot-list refresh, no handling of UA string freezing or Chrome's UA Reduction. A single new browser pattern does not reverse the structural decay of a static UA corpus — it just means the corpus is now current as of this one pattern.
  • New, small risk: historical discontinuity. Because Edge-on-Chromium traffic was previously landing in whatever bucket the prior patterns produced (typically Chrome), upgrading will change historical comparability in any dashboard sourced from this parser. Analytics will show an apparent step change in Edge share on the cutover date that is a classification artifact, not a user-behavior change. This needs to be annotated before it is questioned by stakeholders.
  • PHP compatibility drift is unchanged as a live concern: verify the composer.json PHP constraint against your target (8.2/8.3) and watch for dynamic-property deprecations that strict error handlers escalate to exceptions. A patch release is unlikely to have moved the constraint — confirm rather than assume.
  • Ecosystem signals (dependents, opportunity score) are unchanged; this remains a commodity utility with a slow-moving data set, now demonstrably occasionally maintained.

Key questions

  1. What downstream decision does this output drive? Unchanged — if it gates features, pricing, or bot blocking, this package is disqualified regardless of accuracy.
  2. Does 6.1.4 actually fix our Edge cases? Add an Edge-specific slice to the benchmark: real production Edge UAs (Windows and macOS, several versions) scored against both 6.1.x and matomo/device-detector. Confirm the fix lands and check for regressions in neighbouring Chrome/Chromium patterns.
  3. What is the measured accuracy on a sample of our real production user agents versus matomo/device-detector? Still the gating benchmark, now with Edge removed from the known-disagreement set so the residual gap is cleaner to read.
  4. Which PHP versions and Laravel versions must be supported, and does the (unchanged) package constraint permit them?
  5. Should Client Hints be the primary signal with UA parsing as a fallback? Unchanged — and note this release makes the case stronger: if one browser required a manual regex patch, the model is structurally behind.
  6. Is upstream now a viable patch path, or do we still fork? One merge proves the door is open. Decide the policy: do we wait on PRs (risking another multi-year gap), or vendor now and cherry-pick upstream fixes like 6.1.4 as they land? The latter is the lower-variance option.
  7. Are there privacy/consent implications to persisting parsed device data?

Integration Approach

Stack fit

  • Unchanged. Compatible with a standard Laravel HTTP stack: invoked in middleware or a service class, fed from $request->userAgent() and $request->header('Accept-Language'). No storage, migration, or infrastructure prerequisite.
  • Overlaps partially with what Laravel already exposes natively (Request::userAgent()), so the added value is strictly the parsing/normalization layer.
  • Natural insertion points remain: structured log context, analytics/event enrichment, default-locale resolution, unsupported-browser notice on public-facing funnels, and support-diagnostics payloads. Edge correctness now matters for the last two specifically — an "unsupported browser" interstitial that misreads new Edge is a visible, user-facing defect, and this release reduces that exposure.

Migration path

  • Do not call the package statically from controllers. Bind a BrowserDetectorInterface in a service provider and implement SinergiBrowserDetector behind it. This remains the single highest-leverage decision: it converts a low-activity dependency into a swappable adapter.
  • Configure a driver key (browser_detector.driver = sinergi | matomo) so a replacement can be rolled out per environment without a code change. Still a few hours now versus a refactor later.
  • Pin to 6.1.4 explicitly in composer.lock and tighten the constraint from floating to a caret pin at minimum, ideally an exact pin. Prior guidance to forbid floating constraints stands — and the arrival of an unexpected patch is precisely the scenario that guidance was written for.
  • If the package is retained long-term, still plan to vendor or fork under the org namespace. 6.1.4 slightly improves the "stay upstream" case but does not eliminate the need for a patch path we control.

Compatibility

  • 6.1.4 is a patch release in the existing line: expected to be semver-compatible, no deprecations announced, no breaking changes flagged in the notes. Treat as low-risk but verify — a regex change can alter outputs without altering the API, which is a behavioural break even when it is a version-compatible one.
  • Validate the PHP constraint first; if it caps below your runtime, a fork with a lifted constraint is still required before anything else proceeds.
  • Confirm the Laravel provider is registered manually if auto-discovery is absent, and that the facade alias does not collide with application code.
  • Regenerate the golden-file fixture. The ~50 representative UA strings must be re-run and the diff reviewed deliberately. Any changed classification is either the intended Edge fix or an unintended regression — you need to know which before it reaches a dashboard. Add Chromium Edge (Windows, macOS, Android) to the fixture if absent.

Sequencing

  1. Accuracy spike (1–2 days): run 6.1.4 and matomo/device-detector over a 10k-UA production sample; quantify disagreement rate by browser family and bot classification. Report Edge as a separate line item pre/post upgrade.
  2. Golden-file diff (half day): upgrade to 6.1.4 in a branch, regenerate fixtures, review every changed classification, and record the expected Edge share shift.
  3. Adapter + binding (1 day): interface, value object, config, container registration, unit tests.
  4. Shadow mode (1–2 weeks): log both parsers' results in production; review disagreements before any consumer depends on the output.
  5. Low-stakes rollout: analytics enrichment, log context, locale fallback, support diagnostics — reversible, no user-visible decisions. Annotate the Edge classification cutover date on dashboards.
  6. Decision gate: only if accuracy clears the bar and a maintenance owner is named does it extend to user-facing behavior; otherwise swap the driver to a maintained parser using the same interface.

Operational Impact

Maintenance

  • Revise the prior "upstream maintenance is zero and will remain zero." It is now sporadic and PR-driven, which is meaningfully better but not a cadence you can plan a framework upgrade around. Internal ownership remains mandatory: a dependency register entry flagged "low-activity/unmaintained," a named owner, and an annual review trigger.
  • Steady-state internal cost is unchanged at roughly 2–4 engineer-days per year. If anything, 6.1.4 slightly reduces it by removing one known-misclassification class from the support backlog — but do not reforecast based on a single release.
  • Treat the package as effectively frozen source: pin 6.1.4 exactly, forbid floating constraints, and prefer a vendored fork if patching is anticipated. The upside of vendoring is now clearer — upstream patches like this one become cherry-pickable rather than a dependency on someone else's merge latency.

Support

  • Incident surface is still minimal — this library cannot cause an outage, latency spike, or data loss on its own. Support load appears as low-severity data-quality tickets, not pages.
  • 6.1.4 will likely generate a short-lived bump in those tickets: users and analysts will notice Edge appearing in reports where Chrome previously appeared, and someone will file it as a regression. Pre-empt with a release note to analytics consumers before rollout.
  • Keep the runbook's best-effort framing. Update the known-misclassification examples: Edge-on-Chromium is now handled; Brave and Arc are not, and frozen Safari UA versions remain.

Scaling

  • Unchanged. Parsing runs a large ordered regex list per invocation; negligible under PHP-FPM at normal HTML-request volumes, measurable in high-volume ingestion or per-asset-request middleware.
  • Mitigate by scoping the middleware to HTML routes only, memoizing per request, and caching parsed output keyed by a hash of UA + Accept-Language. 6.1.4 adds a pattern to the table, so per-invocation cost ticks up marginally — immaterial, but another argument for the cache.
  • No horizontal-scaling concerns: stateless, no shared resource, no cold-start cost beyond autoloading.

Failure modes

Failure Impact Mitigation
Misclassification (Brave/Arc, frozen Safari UA, future Chromium derivatives) Skewed analytics, wrong UI branch Restrict to non-decisional uses; shadow-mode benchmark. Edge-on-Chromium removed from this row as of 6.1.4.
Historical discontinuity from the 6.1.4 reclassification Dashboards show a false Edge step-change; looks like a regression Annotate cutover date; regenerate golden files; notify analytics consumers
Regression in adjacent Chrome/Chromium patterns New misclassification introduced by the patch Golden-file diff before merge; shadow mode
PHP deprecations on 8.2/8.3 under strict handlers Exceptions in request path Fork with lifted constraint; CI matrix
Empty or malformed UA Null/default values downstream Null-object value type; explicit fallback tests
Bot list staleness Headless/automation miscounted as human Do not rely on this for fraud or rate limiting
Locale derived from Accept-Language only Wrong default language for some users Treat as a default, always allow explicit override
Another multi-year upstream gap Blocked on unpatched detections Adapter interface makes driver swap a config change; vendored fork

Ramp-up

  • Near-zero for engineers: three classes, a handful of getters, no configuration model to learn. A mid-level developer is productive in under an hour.
  • The real ramp-up cost sits with product and analytics stakeholders, who must internalize that detection is probabilistic and, despite 6.1.4, still versioned to a largely static corpus. Set that expectation before launch, not after the first dashboard discrepancy.

Recommendation: upgraded from "default to the maintained alternative" to "viable as a low-stakes enrichment utility behind an adapter interface, with an explicit owner and a planned exit path." 6.1.4 removes the strongest single argument against adoption (a named, real misclassification of a major browser) and demonstrates upstream is not sealed. It does not supply a maintenance cadence, Client Hints support, or a CVE process, so the constraints stand: not acceptable as a dependency for any user-facing entitlement, security, or bot-management decision. Run the accuracy benchmark including the new Edge slice; if the residual gap versus matomo/device-detector is now narrow, adopt this package pinned at 6.1.4 rather than switching — the switching cost is no longer clearly justified by the data alone.

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.
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource