Closed idealerror closed 9 months ago
Nevermind, this is no longer an issue.
@idealerror Hey, I have the same problem, what fixed it for you? Thanks
I have set $casts for my field as array, and initially it shows ok but after saving it gets mangled
"{\"title\":
nevermind: I fixed it with:
https://github.com/invaders-xx/filament-jsoneditor/issues/27#issuecomment-1827958924
->dehydrateStateUsing(function ($state) { if(is_string($state)){ return json_decode($state, true); } return $state; })
Full field:
\InvadersXX\FilamentJsoneditor\Forms\JSONEditor::make('default_settings')
->modes(['code', 'form', 'text', 'tree', 'view', 'preview'])
->dehydrateStateUsing(function ($state) {
if(is_string($state)){
return json_decode($state, true);
}
return $state;
}),
I'm trying to update an existing 'array' column that originally shows as
When I save it, the column gets stored as:
How do I stop it from sanitizing the column? Is this a filament setting or an issue with this package?