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",
]
[
"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,
}
{
"item-1": true,
"item-2": false,
"item-3": true,
}
How should I do it? for both saving and correct retrieval. Thank you
1 Reply
toeknee
toeknee4mo ago
You'll need to custom cast it? If empty set as false.
Want results from more Discord servers?
Add your server