title: How to insert multiple rows in laravel 5?
body: <p>I want to insert an array with an id : 
  create.blade :</p>
  
  <pre><code>{{ Form::open(array('route' =&gt; 'Charge.store','method'=&gt;'POST')) }}
          &lt;select id="disabledSelect" class="form-control" name="Facture_id"&gt;
              &lt;option value="{{ $Facture-&gt;id }}" &gt;{{ $Facture-&gt;Num }}&lt;/option&gt;
          &lt;/select&gt;
          &lt;br/&gt;
          &lt;div class="form-inline"&gt;
              &lt;div class="form-group"&gt;
                  &lt;input type="text" class="form-control" name="rows[0][Title]" placeholder="libelé"/&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;input type="text" class="form-control" name="rows[0][Quantity]" placeholder="Quantité"/&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;input type="text" class="form-control" name="rows[0][Price]" placeholder="Prix unitaire "/&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;input type="button" class="btn btn-default" value="Ajouter" onclick="createNew()" /&gt;
              &lt;/div&gt;
              &lt;div id="mydiv"&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;br/&gt;
  
          &lt;div class="form-group"&gt;
              &lt;input type="submit" value="Ajouter" class="btn btn-info"&gt;
              &lt;a href="{{ route('Facture.index') }}" class="btn btn-default"&gt;Cancel&lt;/a&gt;
          &lt;/div&gt;
          {{ Form::close() }}
  
  &lt;script&gt;
      var i = 2;
  
      function createNew() {
          $("#mydiv").append('&lt;div class="form-group"&gt;'+'&lt;input type="text" name="rows[' + i +'][Title]" class="form-control" placeholder="libelé"/&gt;'+
                  '&lt;/div&gt;'+'&lt;div class="form-group"&gt;'+'&lt;input type="text" name="rows[' + i +'][Quantity]" class="form-control" placeholder="Quantité"/&gt;'+'&lt;/div&gt;'+'&lt;div class="form-group"&gt;'+'&lt;input type="text" name="rows[' + i +'][Price]" class="form-control" placeholder="Prix unitaire "/&gt;'+'&lt;/div&gt;'+'&lt;div class="form-group"&gt;'+
                  '&lt;input type="button" name="" class="btn btn-default" value="Ajouter" onclick="createNew()" /&gt;'+
                  '&lt;/div&gt;&lt;br/&gt;');
          i++;
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>here is my controller , when I tried to submit the form , it inject rows with value of 0.
  What should I do ? I tried to use <code>elequent bolk</code> data , but the problem remain the same:</p>
  
  <p><a href="https://i.stack.imgur.com/ryt0N.png" rel="nofollow"><img src="https://i.stack.imgur.com/ryt0N.png" alt="enter image description here"></a></p>
  
  <pre><code>public function store(Request $request)
  {
      // validated input request
      $this-&gt;validate($request, [
          'Facture_id' =&gt; 'required',
  
  
      ]);
  
      // create new task
      $rows = $request-&gt;input('rows');
      foreach ($rows as $row)
      {
          $Charges[] = new Charge(array(
              'course_id'=&gt;$request-&gt;input('Facture_id'),
              'Title'=&gt;$row['Title'],
              'Quantity'=&gt;$row['Quantity'],
              'Price'=&gt;$row['Price'],
  
          ));
      }
      Charge::create($Charges);
      return redirect()-&gt;route('Charge.index')-&gt;with('success', 'Your task added successfully!');
  }
  </code></pre>