Get browser name, device, os version in laravel; In this tutorial, you will learn how to get browser name, device, os version in laravel.
Using the jenssegers/agent composer package to get browser name, device, os version in laravel. So, execute the following command on terminal to install jenssergers/agent package into your laravel apps.
How to Get Browser Name, Device, OS Version in Laravel?
- Laravel Get Browser Name and Version
- Laravel Get Device Name
- Laravel Get OS Name
Laravel Get Browser Name and Version
Use the following code to find browser version by passing the result of Agent::browser()
to the version()
method:
$browser = Agent::browser(); $version = Agent::version($browser);
Laravel Get Device Name
You can use the device()
method that can find the user device name that the request was made from. is as follows:
$device = Agent::device();
Laravel Get OS Name
You can use the platform()
method that can find the operating system that the request was made from. is as follows:
$platform = Agent::platform();
Conclusion
In this tutorial, you have learned how to get browser name, device, os version in laravel.
Recommended Laravel Tutorials