spinen/laravel-browser-filter
Laravel middleware that blocks requests from specified browsers and devices using browser-filter rules. Define allowed or denied user agents in config and redirect or reject unsupported visitors before they reach your routes.
Sec-CH-UA), no feature detection, no analytics on browser mix, no bot detection. Any real "browser support strategy" initiative is 10x this surface area — don't let a middleware package stand in for the strategy.Consider it only if all of these hold:
Look elsewhere (or build) if:
mobiledetect/mobiledetectlib, browscap/browscap-php, or whichbrowser/parser — and keep this package's clean route-declared constraint syntax as the design you copy. That's a one-day build and it wins on maintenance, security posture, and framework currency.Sec-CH-UA, Sec-CH-UA-Platform) — the modern replacement for UA sniffing, unsupported here.@supports) and send a capability flag; server-side UA matching is a proxy for the real question and always drifts.To executives: This is a small, single-purpose utility that lets us block or redirect specific browsers on specific pages. The idea is sound and cheap to replicate; the package itself is not a dependency worth betting on. It hasn't shipped a release since 2018, has negligible adoption, and won't run on a current Laravel stack. Recommendation: do not adopt. If the legacy-browser requirement is real, we implement the same pattern in-house in about a day, on a maintained browser-detection library, and we own it.
To engineering: Mine it for design, not code. The valuable part is the ergonomics: browser constraints declared alongside the route, enforced by one middleware, so support policy lives in the route file rather than scattered through controllers. Reimplement that against mobiledetect or whichbrowser, add tests for the UA strings we actually see in logs, and treat the resulting policy as configuration — not as a security boundary, since UA strings are client-controlled. Budget: roughly one engineer-day plus test coverage. The alternative — forking a six-year-old package — costs more over the next two years than writing it fresh.
Framing for the build-vs-buy call: the package scores 0.38 on opportunity and 0.46 overall, with a 2018 last release. It is a reference implementation, not a vendor. The correct output of evaluating it is a design decision ("we want route-level browser policy") plus a small first-party build — not a composer require.
How can I help you explore Laravel packages today?