In pull request #34611 the undocumented `withUserAgent` method has been added to the Laravel HTTP Client. It’s really easy to use.


This has been released in Laravel v8.8.0. If you’re using a Laravel version below v8.8 you can also change the user agent without to much trouble as per the following example:

Http::withHeaders(['User-Agent' => $userAgent])->get($url);