F
Filament7mo ago
CLT99

How show JSON field (casted to array) in InfoList

example {"context": "Request", "message": "messageText"} #❓┊help
6 Replies
Dennis Koch
Dennis Koch7mo ago
Please put some efforts in your question and read https://discord.com/channels/883083792112300104/1167015843020943390
CLT99
CLT997mo ago
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 InfoList
Dennis Koch
Dennis Koch7mo ago
Is it multiple entries or only one?
CLT99
CLT997mo ago
{"context": "request example", "message": "message text", "vehicle": {"plate": "test", "make-model": "Test"}} like this
Dennis Koch
Dennis Koch7mo ago
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) => ...)
Figg
Figg5mo ago
@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.
Want results from more Discord servers?
Add your server
More Posts