Redirecting To External Domains In Laravel Example

Hello artisan,

You know that, 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.

In this tutorial, I will show you how to redirect external url in Laravel. In this laravel redirect away example, you will see we can redirect user to an external url in Laravel with away() helper in Laravel.

See the example code:

return redirect()->away('');


Read also: How to Add cc and bcc in Laravel Mail


Hope it can help you.


#laravel #laravel-9x