title: Insert input array in laravel 5.2
body: <p>I have problem, i want to insert input array in database but just insert 1 row in database i can't insert more than 1 row.</p>
  
  <pre><code>public function checkout(Request $request){
              $input= $request-&gt;all();
  
              $pay = new Pays;
              $bill= new detail_bills;
  
              $id_buy= $request-&gt;get('post_id');
              $name_product= $request-&gt;get('name_session');
              $picture= $request-&gt;get('picture');
              $quantity= $request-&gt;get('qty');
              $price= $request-&gt;get('price');
  
              foreach (Session::get('product') as $key =&gt;$value)
              {
                 $item = array([
                             "id_buy"       =&gt; $id_buy[$key],
                             "name_product" =&gt; $name_product[$key], 
                             "picture"      =&gt; $picture[$key], 
                             "price"        =&gt; $price[$key], 
                             "quantity"     =&gt; $quantity[$key]
                  ]);
  
  
              }
  
              DB::table('detail_bills')-&gt;insert($item );
  }
  </code></pre>