How to show array key in TextColumn
Hi i have Variant model whre i save json in format like this {"Name":"Value"} and i'm casting it
How could i display key into textcolumn or other column?
Because if i put it into textCol it in state is only value
ps: I'm new to filament π
6 Replies
You can use
->formatStateUsing(fn ($state) => ...)
to control the display.Yeah i tried it in the meantime however state gets me the value not the whole array and I'm confused π
Solution
Try
->getStateUsing(fn ($record) => $record->variant_attributes_json)
thenYeah $record works, thanks
Not work for me (in infolist and table)
Please open an help thread with some info then