Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filamentβ€’3y agoβ€’
8 replies
ouch

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
    protected $casts = [
        'variant_attributes_json' => 'array',
    ];
    protected $casts = [
        'variant_attributes_json' => 'array',
    ];

How could i display key into textcolumn or other column?
Because if i put it into textCol it in state is only value
  Tables\Columns\TextColumn::make('variant_attributes_json')
  Tables\Columns\TextColumn::make('variant_attributes_json')


ps: I'm new to filament πŸ™‚
Solution
Try
->getStateUsing(fn ($record) => $record->variant_attributes_json)
->getStateUsing(fn ($record) => $record->variant_attributes_json)
then
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel β€’ Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How show JSON field (casted to array) in InfoList
FilamentFFilament / β“β”Šhelp
3y ago
Is it possible to display key : value in a TextColumn ?
FilamentFFilament / β“β”Šhelp
13mo ago
Select and TextColumn with Associative Array
FilamentFFilament / β“β”Šhelp
2y ago
How to show simple array on view page?
FilamentFFilament / β“β”Šhelp
3y ago