Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel 5 Laravel-发出请求的页面路径_Laravel 5_Laravel Routing_Laravel Request - Fatal编程技术网

Laravel 5 Laravel-发出请求的页面路径

Laravel 5 Laravel-发出请求的页面路径,laravel-5,laravel-routing,laravel-request,Laravel 5,Laravel Routing,Laravel Request,如何确定发出请求的页面的路径 我尝试了$request->path()或request::path(),但这两种方法返回了请求的路径 您可以尝试以下方法: $request->header('referer'); 另外,URL::previous将为您提供URL,例如: \URL::previous(); 更新:验证失败时,您可以使用此选项将用户发送回表单: return redirect()->back();//您也可以使用->withInput()->withErrors(…) 您可以尝

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

我尝试了
$request->path()
request::path()
,但这两种方法返回了请求的路径

您可以尝试以下方法:

$request->header('referer');
另外,
URL::previous
将为您提供
URL
,例如:

\URL::previous();
更新:验证失败时,您可以使用此选项将用户发送回表单:

return redirect()->back();//您也可以使用->withInput()->withErrors(…)
您可以尝试以下方法:

$request->header('referer');
另外,
URL::previous
将为您提供
URL
,例如:

\URL::previous();
更新:验证失败时,您可以使用此选项将用户发送回表单:

return redirect()->back();//您也可以使用->withInput()->withErrors(…)