Php Larvel:从输入::get()返回null

Php Larvel:从输入::get()返回null,php,laravel,laravel-4,Php,Laravel,Laravel 4,我需要一个动态表单,它是根据数据库条目创建的。要将数据输入数据库,这也需要是动态的。由于某种原因,我的表单值变为null 我的表单循环 @foreach ($keyAccounts as $keyAccount) {{ Form::label($keyAccount->name, $keyAccount->name.':', array('class' => '')) }} {{ Form::text($keyAccount->name)}

我需要一个动态表单,它是根据数据库条目创建的。要将数据输入数据库,这也需要是动态的。由于某种原因,我的表单值变为null

我的表单循环

@foreach ($keyAccounts as $keyAccount)
        {{ Form::label($keyAccount->name, $keyAccount->name.':', array('class' => '')) }}
        {{ Form::text($keyAccount->name)}}<br />
    @endforeach
我得到一个SQL错误中的year_to_date变量为null,即使数据已填写

这是我的输入::get()的var_转储

我不知道;我不知道为什么,但是第一个条目是空的。数据库中总共有三个条目,并且没有名称变量为null

自动转换为存在空格字符的下划线。删除空格字符或转换为下划线。尝试输入::get('hsbc_-dad')


谢谢,您已经讲了一个小时了:)
<label for="hsbc dad" class="">hsbc dad:</label>
        <input name="hsbc dad" type="text" id="hsbc dad"><br />
                <label for="sdsad" class="">sdsad:</label>
        <input name="sdsad" type="text" id="sdsad"><br />
                <label for="dfffff" class="">dfffff:</label>
        <input name="dfffff" type="text" id="dfffff"><br />
foreach($keyAccounts as $keyAccount){
        $assignedAccount = new AssignedAccount;
        $assignedAccount->contribution_id = $last_con_id->contribution_id;
        $assignedAccount->key_account_id = $keyAccount->key_account_id; 
        $assignedAccount->year_to_date = Input::get($keyAccount->name);
        $assignedAccount->save();
    }
NULL string(1) "3" string(1) "3"