In this snippet, we'll see how to get user-agent from user request in laravel.
We’ll see a number of methods to get user-agent in Laravel
$agent = $request->header('user-agent');
$agent = request()->header('user-agent');
$agent = Request::header('user-agent');
All of these code snippet return the User-agent in Laravel.