title: laravel submitting multiple rows of a form to mysql by creating duplicate rows
body: <p>i have this form in larvel that will submit data to mysql database
  every time i click <code>Add More</code>new row is created using script i want to submit all the rows at ones</p>
  <pre><code>&lt;form action={{route('invetory.create')}} method=&quot;post&quot;&gt;
      @csrf
      &lt;div id=&quot;service&quot;&gt;
          &lt;input type=&quot;text&quot; name=&quot;item&quot;/&gt;
          &lt;input type=&quot;text&quot; name=&quot;tax&quot; /&gt;
          &lt;input name=&quot;price&quot; type=&quot;text&quot; /&gt;
          &lt;input name=&quot;selling_price&quot; type=&quot;text&quot; /&gt;
          &lt;input name=&quot;total_price&quot; type=&quot;text&quot; /&gt;
          &lt;input type=&quot;submit&quot;/&gt;
      &lt;/div&gt;
  &lt;/form&gt;   
  &lt;a class=&quot;btn-floating btn-primary&quot; id=&quot;addmore&quot;   onclick=&quot;duplicate()&quot;&gt;Add More&lt;/a&gt;
  
  </code></pre>
  <p>input fields duplicating script</p>
  <pre><code>&lt;script&gt;
  function duplicate() {    
      var original = document.getElementById('service');
      var rows = original.parentNode.rows;
      var i = rows.length - 1;
      var clone = original.cloneNode(true); // &quot;deep&quot; clone
      clone.id = &quot;duplic&quot; + (i); // there can only be one element with an ID
      original.parentNode.insertBefore(clone, rows[i]);
  }&lt;/script&gt;
  </code></pre>
  <p>invetory.create route in web.php</p>
  <pre><code>`Route::post('/inventory', 'App\Http\Controllers\InventoryController@create')-&gt;name('invetory.create');`
  </code></pre>
  <p>funtion in  InventoryController.php</p>
  <pre><code>public function create(Request $REQUEST){
      Inventory::Create($REQUEST-&gt;all());
      return redirect()-&gt;action([InventoryController::class, 'index']);
  }
  </code></pre>