Laravel - 发出请求的页面路径

Laravel - Path of page from which request was made

如何确定发出请求的页面路径?

我试过 $request->path()Request::path() 但这两个 return 请求的路径..

你可以试试这个:

$request->header('referer');

另外URL::previous会给你那个URL,例如:

\URL::previous();

更新: 您可以使用它在验证失败时将用户发送回表单:

return redirect()->back(); // You may use ->withInput()->withErrors(...) as well