whereIn
:public function storebulk(Request $request, $id)
{
$ids= ['8','9','10']; //sent from the front-end
$barcode = Barcode::whereIn('id', $ids)->update(['image_id'=>$id]);
return 'Done';
}
whereIn
。whereIn
定义为-
whereIn方法验证给定列的值是否包含在给定数组中。public function storebulk(Request $request,$id)
{
$ids= ['8','9','10']; //sent from the front-end
$barcode = Barcode::whereIn('id', $ids)->update(['image_id'=>$id]);
return 'Done';
}
链接到文档
whereIn
。 - lagboxBarcode::whereIn('id', $ids)->update(['image_id'=>$id]);
- STA