Advertisement
aliemtakarai

bulk insert

Jun 13th, 2021
935
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement