title: Laravel 5 Multiple Insert in Foreach Loop
body: <p>I am trying to multiple images insert with Laravel 5.1 using one controller method.</p>
  
  <p>Here is my tried Code:</p>
  
  <pre><code>$images = Input::file('product_images');
  
  foreach ($images as $image) {
  
      $productImage = new ProductImage();
  
      $filename = Input::get('imalatci_id') . '_product' . '_' . date('Y_m_d_H_i_s') . '_' . $image-&gt;getClientOriginalName();
      Image::make($image-&gt;getRealPath())-&gt;resize(500, 400)-&gt;save('images/products/' . $filename);
  
      $productImage-&gt;product_id = $productId;
      $productImage-&gt;path = 'images/products/' . $filename;
      $productImage-&gt;save();
  
  }
  </code></pre>
  
  <p>This code inserts single row to table.</p>
  
  <p>How could gain multiple inserting?</p>