Redirect to external URL with return in laravel

后端 未结 8 1459
野的像风
野的像风 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 14:06

    If you're using InertiaJS, the away() approach won't work as seen on the inertiaJS github, they are discussing the best way to create a "external redirect" on inertiaJS, the solution for now is return a 409 status with X-Inertia-Location header informing the url, like this:

    return response('', 409)
                ->header('X-Inertia-Location', $paymentLink);
    

    Where paymentLink is the link you want to send the user to.

    SOURCE: https://github.com/inertiajs/inertia-laravel/issues/57#issuecomment-570581851

提交回复
热议问题