我正在开发一个使用Laravel的项目,其中我们使用phpCAS进行用户身份验证。我正在使用这个用于phpCAS的Laravel包:https://github.com/subfission/cas
在用户通过身份验证后,我希望将他/她返回到他/她被重定向到CAS服务器登录的URL。
我使用了url()->previous();但它在google chrome中返回了关于引用URL (控制器/动作)的错误信息。
我怎样才能做到这一点?谢谢!
发布于 2018-04-11 17:53:15
使用intended()方法
The intended method on the redirector will redirect the user to the URL they were attempting to access before being intercepted by the authentication middleware. A fallback URI may be given to this method in case the intended destination is not available.
示例:return redirect()->intended('dashboard');
https://stackoverflow.com/questions/49770946
复制相似问题