Setting table columns based on model's json column
I have this structure:
Form
Response
a form has n responses, 1 response belongs to 1 form
a form has a json field called fields - example:
a response has a field called responses - example:
in the form's responses table, i want to set the table's columns dynamically, so it shows all form fields and their responses. im trying this:
(file
which results into this image here, where the birthdate isnt shown. why??? if i just dd
Form
Response
a form has n responses, 1 response belongs to 1 form
a form has a json field called fields - example:
a response has a field called responses - example:
in the form's responses table, i want to set the table's columns dynamically, so it shows all form fields and their responses. im trying this:
(file
app/Filament/Resources/ResponseResource.php)which results into this image here, where the birthdate isnt shown. why??? if i just dd
$record->responses[str($field['name'])->slug()->toString()] in my tinker, it works, it shows -> "2023-11-25"