Filament Table Group by key in JSON column of query

I have a json column in my MySQL DB. I can easily display the data in the table using . notation. This works fine for display TextColumn::make('json.key')->label('label')->sortable(), When I try to make a group using . notation though it fails with the error getRelated() = null ->groups(['json.key']) I have got a way to group it using
->groups([
Group::make('json')
->getTitleFromRecordUsing(fn(model $record): string => ucfirst($record->json->key))
->titlePrefixedWithLabel(false),
])
->groups([
Group::make('json')
->getTitleFromRecordUsing(fn(model $record): string => ucfirst($record->json->key))
->titlePrefixedWithLabel(false),
])
but it is not summarizing the rows per group but does summarize at the bottom of everything.
No description
1 Reply
andries
andriesβ€’6mo ago
I am looking for the same thing, but the fact that is . notated, makes the Group class assume it is a relationship. I am not even able to get them grouped... πŸ™‚
Want results from more Discord servers?
Add your server