Laravel get intended url

前端 未结 4 730
悲哀的现实
悲哀的现实 2020-12-31 11:08

I use a common httpRequest to login, so I could use Redirect::intended(); to lead the user to a url before them being lead to the login page. That all works we

4条回答
  •  一整个雨季
    2020-12-31 11:29

    In your controller action use:

    $url = Redirect::intended( ... )->getTargetUrl();

    (Where ... is the fallback url)

    Then return it in the JSON response, and use window.location or other to do the redirect.

提交回复
热议问题