Redirect to external URL with return in laravel

后端 未结 8 1458
野的像风
野的像风 2021-02-01 13:41

I am trying to send one time password to a user using SMS INDIA HUB API. For that purpose I need to redirect to a URL format:

http://cloud.smsindiahub.in/vendorsms/pushs

8条回答
  •  长情又很酷
    2021-02-01 13:53

    For Laravel 5.x / 6.x / 7.x use:

    return redirect()->away('https://www.google.com');
    

    as stated in the docs:

    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:

提交回复
热议问题