Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何确定发出请求的页面路径?
我已经尝试过$request->path(),或者Request::path()这两个返回请求的路径..
$request->path()
Request::path()
你可以试试这个:
$request->header('referer');
也会URL::previous给你URL,例如:
URL::previous
URL
\URL::previous();
更新:您可以使用它在验证失败时将用户发送回表单:
return redirect()->back(); // You may use ->withInput()->withErrors(...) as well