How do I redirect to a URL with query parameters?

The approved answer explains it all, according to the documentation. However, if you are still interested in finding some kind of "hard-coded" alternative:

$link = "https://example.com?key1={$value1}&key2={$value2}";

Then,

return redirect($link);

Reference

If the link is to a page on your domain, you don't need to re-write the domain name, just:

$link = "?key1=${value1}&key2=${value2}";

Laravel will automatically prepend the URL with your APP_URL (.env)


Use:

return redirect($link);

If you want to redirect a named route with query string, use:

return redirect()->route('route_name',['key'=> $value]);

Documentation