I’m trying to update a structure field but don’t how what format to pass it to the $page->update() function. My structure field has the following setup:
poptions: label: Product options type: structure style: table fields: title: label: Title type: text required: true quantity: label: Quantity type: number required: true price: label: Price type: number step: .01
Now I’m getting a new product quantity through a webhook and managed to “find” the right field in the structure but I see no way updating it.
I tried updating the object I get back from ->toStructure(), updating it and passing it back but ->update() doesnt like the value.
$poptions = $project->poptions()->toStructure(); $poptions[$field['value']]['quantity'] = $quant3; $project->update([ 'poptions' => $poptions ]);
Any hint would be great, Thank you!