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
Bad Browser Detect

Bad Browser Detect Laravel Package

andrey-helldar/bad-browser-detect

andrey-helldar/bad-browser-detect is a Laravel package for detecting outdated or unsupported browsers. It helps flag legacy clients so you can show upgrade warnings, redirect visitors, or restrict access through simple configuration.

View on GitHub
Deep Wiki
Context7

Determine the minimum acceptable version of the browser and notify the user if the version does not match the required version.

Frequently asked questions about Bad Browser Detect
How do I install andrey-helldar/bad-browser-detect in Laravel?
Install the package with Composer using composer require andrey-helldar/bad-browser-detect. Laravel package discovery typically registers the service provider automatically, so manual provider entries are usually unnecessary. After installation, publish and review the configuration file if the package provides one before enabling detection.
How does the bad-browser-detect middleware work?
The package works by running middleware that inspects each incoming request's User-Agent against your configured browser rules. When a visitor matches a legacy or unsupported browser threshold, the middleware can redirect, block, or render a notice depending on your configuration. You attach it to the routes or route groups where outdated-browser handling should apply.
How do I configure minimum browser versions?
Browser rules and minimum version thresholds are defined in the package configuration file. You list the browsers you care about and the lowest acceptable version, and requests below that threshold are flagged. Keep the rules updated as browser versions advance so legitimate users are not caught by stale limits.
Can I redirect outdated browser visitors to a custom page?
Yes. The configuration lets you define a redirect target for flagged visitors, so outdated browsers can be sent to an upgrade page or a dedicated notice route. Make sure that redirect route is excluded from the middleware to avoid loops. You can also choose other responses such as blocking access or showing a view.
How do I show a custom view or notice for unsupported browsers?
You can point the package at a custom Blade view that explains the browser is outdated and suggests an upgrade. Configure the response type and view path in the package configuration. The view can include links to supported browsers while leaving the rest of your application untouched.
What Laravel versions does bad-browser-detect support?
Support depends on the package's Composer constraints, so check the require section of its composer.json and the README before installing. The package is built as a framework-native Laravel integration using middleware and configuration. If you are on an older Laravel release, confirm compatibility or pin a package version that matches your framework version.
How do I use Blade helpers for outdated browser warnings?
The package provides Blade helpers for conditional markup, letting you show upgrade notices or fallback content only when a legacy browser is detected. Use them in layouts where you want a banner without blocking the whole page. Combine helpers with middleware when you need both soft warnings and hard restrictions.
How do I test browser detection middleware in Laravel?
You can test the middleware in Laravel feature tests by sending requests with different User-Agent headers and asserting redirects, views, or blocks. Use the package configuration in your tests to set known browser thresholds. This keeps detection behavior covered as rules change.
Will bad-browser-detect block search engine bots or affect SEO?
Be careful with blocking responses because search engine crawlers also send User-Agent strings and may be affected if they match your rules. Prefer redirects or notices for real users and allowlist known bots where needed. Review your rules and test with common crawler User-Agents before deploying to production.
What are alternatives to bad-browser-detect for Laravel?
Alternatives include building your own User-Agent checks, using a general browser-detection library such as whichbrowser or browscap, or relying on client-side feature detection. bad-browser-detect is convenient when you want Laravel middleware, configurable thresholds, and Blade helpers in one package. Choose based on whether you need server-side blocking or just friendly upgrade messaging.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections