Redirecting to External Domains from Laravel

developeralamin

Al-Amin Islam

Posted on May 27, 2024

Redirecting to External Domains from Laravel

Sometimes you may need to redirect to a domain outside of your application. You may do so by calling the away method, which creates a RedirectResponse without any additional URL encoding, validation, or verification:

return redirect()->away('https://www.google.com');
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
developeralamin
Al-Amin Islam

Posted on May 27, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related