Based on MobileDetect, the jenssegers-agent package is a desktop/mobile user agent parser that supports Laravel. This package gives you a service facade that can be used in any PHP application. It also comes with a Laravel service provider.
The Agent service offers more than just user agent helps; it also offers a language helper, platform, device name method, and more. For instance, you could use the following technique to obtain the supported browser languages:
Agent::languages(); // [‘en-us’, ‘en’]
You might set the locale in a middleware during a request by using the languages method. Here is a little example, simply to give you an idea, that comes to mind:
The locale will be defined by the config(‘app.fallback_locale’) parameter if you do not support the localization. In middleware, you can also use the languages() method to reroute a locale-specific route prefix /{locale}/ according to the language supported by the user agent.
The Agent
 service can also determine if the current user agent is a bot and what type of bot:
Finally, you can utilize the appropriately designated methods on the façade to obtain the device name, platform, and browser: