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 Laravel Package

troovers/browser

A Laravel/PHP package for detecting browsers, platforms, and devices from user-agent strings, with a simple API to tailor responses and features based on the visitor’s environment.

Deep Wiki
Context7

troovers/browser is a lightweight browser and device detection package for Laravel, giving your application a clean API to identify the client browser, platform, and device type from incoming requests. It integrates with the framework via a service provider, facade, and Blade helpers, so you can tailor responses, redirects, or views without pulling in heavy dependencies.

  • Parse user agents into browser, version, OS, and device metadata
  • Laravel facade and dependency-injection friendly service
  • Blade directives and request macros for quick checks
  • Configurable detection rules and custom mappings
  • Middleware support for conditional routing and responses
Frequently asked questions about Browser
What does the troovers/browser package do in Laravel?
troovers/browser is a Laravel package for detecting browser details from incoming requests. It identifies the browser name, version, platform, and device from the user agent. You can use those details for analytics, conditional rendering, or access rules. The package is described as having a simple, framework-friendly API.
How do I install troovers/browser in a Laravel app?
Install the package with Composer using the troovers/browser package name. In a typical Laravel package setup, service provider discovery registers it automatically, but you should follow the README for any required setup steps. If the package provides configuration or publishable assets, run the documented publish command after installation.
How do I get the browser name and version from a request?
Use the package's request-based API to read the detected browser name and version from the current user agent. The overview confirms that browser name and version are core detection outputs. Check the README for the exact method names and return format. You can then store or compare those values in controllers, middleware, or Blade views.
Can I detect the platform and device type from the user agent?
Yes. The package is described as detecting platform and device from the incoming request user agent. That lets you branch logic by platform or by device category such as mobile or desktop. Verify the exact device labels and platform strings in the README before relying on them.
What can I use browser detection for in a Laravel application?
Browser detection is useful for analytics segmentation, serving conditional views, and applying access rules based on browser or device. You can log detected browser and platform values with request data or use them in middleware. Keep in mind that user-agent data is a heuristic, not a security guarantee.
How does troovers/browser integrate with Laravel requests, middleware, and configuration?
The package is designed around Laravel request handling, so you can read detected values in controllers, middleware, or views. The overview describes a simple framework-friendly API, but it does not list exact method names or configuration options. Check the README for any publishable config file and for the recommended way to access the detector.
Is troovers/browser safe to use for production access rules?
It can support production use cases, but user-agent detection should be treated as best-effort because clients can spoof or omit headers. Do not use browser or device detection as the only control for authentication or sensitive access rules. Review the package's Composer constraints, release history, and issue activity before deploying.
How should I test browser detection in my Laravel app?
Test browser detection by passing representative user-agent strings through Laravel's request or HTTP testing helpers and asserting the detected browser, version, platform, and device. Include common desktop and mobile agents plus missing or malformed user agents. If the package exposes a parser service, unit test that directly as well.
Which Laravel versions does troovers/browser support, and is it maintained?
The provided overview does not list supported Laravel versions or maintenance status. Check composer.json, Packagist, and the source repository for Laravel framework constraints, recent releases, and open issues. Confirm compatibility before adding it to an existing Laravel app.
How does troovers/browser compare with other user-agent detection options?
Alternatives include parsing the user agent yourself, using PHP's get_browser with browscap data, or choosing another user-agent detection package. Compare the detection fields you need, Laravel integration, test coverage, and recent maintenance. For simple analytics or conditional rendering, a lightweight Laravel package may be enough.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons