0
根据第19集Laravel 5.4。从laracasts.com视频的Scratch(时间4:53)开始,代码request(['name', 'email', 'password'])
应该从用户注册表单返回包含姓名,电子邮件和密码的数组。为什么request()帮助函数返回null
但在我的情况下,它返回null
。
我敢肯定,窗体是好的,因为request()->only(['name', 'email', 'password'])
的作品。它正确返回Array([name] => awesomename [email] => [email protected] [password] => asdfadsf)
。
什么可能是错的?
我知道。这就是为什么我不了解视频的原因。它是错误吗? – Miloslav21
不,你只是不正确地使用帮手。该方法签名只允许一次传递一个密钥。 – btl
请观看[https://laracasts.com/series/laravel-from-scratch-2017/episodes/19?autoplay=true](https://laracasts.com/series/laravel-from-scratch-2017/episodes/19?autoplay = true),时间4:53 – Miloslav21