FilamentF
Filament16mo ago
2 replies
pocket.racer

How to change the resulting json for Checkbox List?

Currently I'm trying to use the checkbox list field

https://filamentphp.com/docs/3.x/forms/fields/checkbox-list

However it save the resulting json as something like this, notice item-2 is not inside the array as it is not checked

[
    "item-1",
    "item-3",
]


But i want it to save as this kind of json instead

{
    "item-1": true,
    "item-2": false,
    "item-3": true,
}


How should I do it? for both saving and correct retrieval. Thank you
Was this page helpful?