[英]Inject values in $request->input() from controller Laravel 5.2
Is there a way to do something like this in the controller? 有没有办法在控制器中执行类似的操作?
$request->input(['new_field_name' => 'new_val']);
I've googled a lot, but the only thing I've found was related to Laravel's 4.x formatInput method, which has been removed from the 5.x 我已经在Google上进行了很多搜索,但是我发现的唯一内容与Laravel的4.x formatInput方法有关,该方法已从5.x中删除。
I need to inject a specific field in the $request when the request has passed the validation, then save the new record in the db. 当请求通过验证时,我需要在$ request中注入特定字段,然后将新记录保存在db中。
Any clue? 有什么线索吗? Thanks to everyone!
谢谢大家!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.