【发布时间】:2018-10-29 15:48:26
【问题描述】:
我在获取 Laravel 网址时遇到问题。
我有一个页面,如果用户没有登录,它会将用户重定向到错误的 url,它会给出一个错误。
我正在使用redirect()->intended($this->redirectPath()); 找回用户登录后他在页面上的位置,所以我必须以某种方式编写代码来检查什么是重定向 URL,如果它是会给出错误的 URL,
我知道 URL 是什么,它必须将用户重定向到我需要设置的另一个 URL。
我尝试了不同的方法
$this->redirectPath() == 'here goes the url'
喜欢
redirect()->intended($this->redirectPath()) == 'again url here'
但没有任何效果。
【问题讨论】: