TextColumn relation first item

->columns([ Tables\Columns\TextColumn::make('users') ]) ->filters([ how can i get first item in TextColumn ??
4 Replies
jkbcoder
jkbcoder11mo ago
how the query should be ?? the $state return string
LeandroFerreira
LeandroFerreira11mo ago
you can use $record ->formatStateUsing(fn ($record): string => $record->users[0]->name ?? '')
jkbcoder
jkbcoder11mo ago
it work , thank you .