aliemtakarai

bulk insert

Jun 13th, 2021
540
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for ($i=0; $i < $count; $i++) {
  2.     $detailMaterial[] = [
  3.                         'material_id' => $request->material[$i],
  4.                         'qty' => $request->qty[$i],
  5.                         'price' => $request->price[$i],
  6.                         'total' => $request->total[$i],
  7.                         'building_work_id' => $request->work[$i],
  8.                         'home_number_id' => null,
  9.                         'purcash_id' => $purcashOrder->id
  10.                     ];
  11. }
  12.  
  13. PurcashOrderDetail::insert($detailMaterial);
RAW Paste Data