> For the complete documentation index, see [llms.txt](https://liseen315.gitbook.io/laravel/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liseen315.gitbook.io/laravel/shou-ji-he-chu-li-yong-hu-shu-ju/zong-jie.md).

# 总结

有很多方法可以获得相同的数据：使用Request facade，使用request()全局帮助程序，并注入Illuminate\Http\Request实例。 每个都暴露了获取所有输入，一些输入或特定数据的能力，并且可以对文件和JSON输入进行一些特殊考虑。

URI路径段也是用户输入的可能来源，它们也可以通过请求工具访问

验证可以使用Validator::make()手动执行，也可以使用validate()方法或表单请求自动执行。 验证失败后，每个自动工具都会将用户重定向到上一页，并保存所有旧输入并传递错误.

还需要保护视图和Eloquent模型免受恶意用户输入的影响。 使用双重大括号语法（{{}}）保护Blade视图，该语法可以转义用户输入，并通过使用$request-> only()将特定字段传递到批量方法并通过在模型上定义批量赋值规则来保护模型。
