i want to update label value on my database using my controller,depending on the project_id
here is how the database look like
id
project_id
content : [{“id”:1,”reference”:”CM01″,”label”:”test”,”status”:”pending”,”priority”:”urgent”},{“id”:2,”reference”:”CM02″,”label”:”test2″,”status”:”pending”,”priority”:”urgent”},
…..
]
i’ve tried this but it’s not working :
$e_service = array_replace(json_decode($table->e_service, true), [
'label' => $request->label,
]);
$table->update([
'e_service' => json_encode($e_service)
]);
thank you in advance for your help.