getModel())::where('product_id', $productId); if (!is_null($type)) $query->where('type', $type); return $query->delete(); } }