How show JSON field (casted to array) in InfoList
example {"context": "Request", "message": "messageText"} #❓┊help
6 Replies
Please put some efforts in your question and read https://discord.com/channels/883083792112300104/1167015843020943390
TextEntry::make('interests')
->label('Richiesta')
->weight(FontWeight::Medium)
->size(TextEntry\TextEntrySize::Small)
protected $casts = [
'interests', 'array',
'status' => LeadStatus::class,
];
I want display it as key-value into InfoListIs it multiple entries or only one?
{"context": "request example", "message": "message text", "vehicle": {"plate": "test", "make-model": "Test"}} like this
I am not 100% sure. I'd try RepeatableEntry (https://filamentphp.com/docs/3.x/infolists/entries/repeatable) and see whether you can access the key on the TextEntry via
getStateUsing(fn ($record, $state) => ...)
@CLT99 Did you ever work this out? I would have thought that the RepeatableEntry would be compatible with the form Repeater field, and was meant to iterate over a json field, but this does not seem to be the case.