Indirect modification of overloaded property App\Dossier::$program has no effect
The problem is that calling $dossier->program
does not actually access the property directly in Eloquent type models but rather calls a __get
method.
That get method does not return a reference to the property. What you should do is grab the original property, modify it and then put it back:
$dossier=Dossier::where('_id',(int)$request->input('dossier_id'))->first();$originalProgram = $dossier->program;$originalProgram[$request->input('program')]['cities'][$request->input('city')]['services'][$request->input('service')][$request->input('name')]=$request->input('value');$dossier->program = $originalProgram;$dossier->save();