format data in filament table

in my sql i have column 'translation' which looks like this
{"en": "gamarjoba", "sl": "haha"}
{"en": "gamarjoba", "sl": "haha"}
. i want to have 2 row in filament table, english and sloven how ican take only en value from this and also only sl to use it.
1 Reply
gigiloouu
gigiloouuOP2mo ago
anyone?
TextColumn::make('value.sl')
->label('Slovenian Translation')
->sortable()
->searchable(query: function (Builder $query, string $search): Builder {
return $query->orWhereRaw("UPPER(json_unquote(json_extract(`value`, '$.sl'))) LIKE ?", ["%" . strtoupper($search) . "%"]);
}),
TextColumn::make('value.sl')
->label('Slovenian Translation')
->sortable()
->searchable(query: function (Builder $query, string $search): Builder {
return $query->orWhereRaw("UPPER(json_unquote(json_extract(`value`, '$.sl'))) LIKE ?", ["%" . strtoupper($search) . "%"]);
}),
i make something like this but not working
Want results from more Discord servers?
Add your server