title: Laravel 4 Form Model Binding with Dynamic Form Not Properly Filling In
body: <p>I am having trouble getting a dynamic form to properly load. I have a form that a user can click a button and add input fields to their hearts content. I have been able to json_encode and store the information but when I try to edit the form Laravel only creates and fills in the default inputs, leaving out the input fields and data created by the user. How can I get Laravel's form model-binding to display the additional fields and information? Or am I just form model-binding incorrectly? The user can push "Add Another Fence" and another copy of the form is added to the bottom. So, in this case (I didn't include the entire form because it is very long), they could press the "Add Another Fence" button and another input with class "gateNumber" and a newly created id of "gateNumber_2" would appear at the bottom. If anyone knows how to get the dynamic data to bind and display or point out where I am going wrong it will be greatly appreciated! Thank you so much!</p>
  
  <p>Here is my Routes for the edit:</p>
  
  <pre><code>/*Edit Orders (GET)*/
  Route::get('orders/{orders}/edit', array(
      'as'    =&gt; 'order-edit',
      'uses'  =&gt; 'OrderController@getEdit'
  ));
  /*Edit Order (POST)*/
      Route::post('/orders/{orders}/edit', array(
      'as'    =&gt; 'order-edit-post',
          'uses'  =&gt; 'OrderController@postEdit',
      ));
  </code></pre>
  
  <p>View (or at least a snippet, the form is very long):</p>
  
  <pre><code>@extends('layout.main')
  @section('content')
  {{ Form::model($order, array('route'=&gt;array('order-edit-post', $order-&gt;id), 'name', '=', 'orderForm', 'id', '=', 'orderForm')) }}
   &lt;fieldset id="customerInfo"&gt;
       {{ Form::label('order_name', 'Order Name:')}}
       {{ Form::text('order_name') }}
          @if($errors-&gt;has('order_name'))
      {{ $errors-&gt;first('order_name') }}
      @endif
  &lt;legend&gt;&lt;strong&gt;Gate Information&lt;/strong&gt;&lt;/legend&gt;
      {{ Form::select('gateNumber_1',
          array(
              'select'    =&gt; 'Gates Needed',
              '0'         =&gt; '0',
              '1'         =&gt; '1',
              '2'         =&gt; '2',
              '3'         =&gt; '3',
      ), null,
      array('class'       =&gt; 'gateNumber')) }}
  &lt;div&gt;
      &lt;input type="button" id="btnAddFence" value="Add Another Fence" /&gt;
      &lt;input type="button" id="btnDelFence" value="Remove Fence" /&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p>And Order Controller:</p>
  
  <pre><code>public function getEdit($id){
          $order = Order::where('id', '=', $id);
  
          if($order-&gt;count()) {
              $order = $order-&gt;first();
              $order-&gt;order_serialized = json_decode($order-&gt;order_serialized);
  
              foreach($order-&gt;order_serialized as $key =&gt; $value){
                  $order-&gt;$key = $value;
              }
              return View::make('orders.edit')
                      -&gt;with('order', $order);
          }   else {
              return App::abort(404);
          }
      }
  
      public function postEdit($id){
          $validator = Validator::make(Input::all(),
              array(
                  'order_name'            =&gt;'required',
                  'phone'                 =&gt;'required|min:10|numeric',
                  'email'                 =&gt;'required',
                  'st_address'            =&gt;'required',
                  'post_date'             =&gt;'required',
              )           
          );
  
          if($validator-&gt;fails()){
              return Redirect::route('order-edit', $id)
                      -&gt;withErrors($validator)
                      -&gt;withInput()
                      -&gt;with('global', 'You done messed up.');
          }   else {
              /*Edit Order*/
              $order                      = Order::find($id);
  
              $order-&gt;order_name          = Input::get('order_name');
              $order-&gt;phone               = Input::get('phone');
              $order-&gt;email               = Input::get('email');
              $order-&gt;st_address          = Input::get('st_address');
              $order-&gt;post_date           = Input::get('post_date');
              $order-&gt;order_serialized    = json_encode(Input::except('_token', 'submit'));
  
              if($order-&gt;save()){
                  return Redirect::route('home')
                          -&gt;with('global', 'Your order has been edited.');
              }
          }
  
          return Redirect::route('home')
                  -&gt;with('global', 'Your order could not be edited.');
  
      }
  </code></pre>