Laravel 5获取数组的输入值

Tar*_*tar 5 php input laravel laravel-5 laravel-form

我有一个像文本字段

{!! Form::textarea('representive[address_1]' ,null ,['class' =>'textboxlong form-control','style'=>'height:60px;']) !!}
Run Code Online (Sandbox Code Playgroud)

在我的形式.当我试图在我的控制器中获取它的值但是它为空.我尝试的是

$adress = Request::get('representive.0.address_1');
Run Code Online (Sandbox Code Playgroud)

我也尝试过其他一些方法,但最终无法找到合适的解决方案.我如何获得该字段的值?任何帮助,将不胜感激.

Bog*_*dan 6

Request::get()方法由实施Symfony\Component\HttpFoundation\RequestIlluminate\Http\Request类延伸.此方法不解析使用点符号传递的字符串参数,如Laravel所做的那样.您应该使用以下Request::input内容:

$adress = Request::input('representive.address_1');
Run Code Online (Sandbox Code Playgroud)

作为替代方案,您也可以使用Input外观和做Input::get().