What I have: I have a table with a one-to-many boolean icon column (positionData.is_active) Currently the State is populates with all the records for example (true, false, true)
What I want to do: I just want a single value returned.
What I have tried If it was a TextColumn I could use something like
TextColumn::make('positionData.is_active)->formatStateUsing( function ($record) { $isActive = $record->positionData->sortByDesc('year')->values()->first()->is_active; // render stuff here ... }
TextColumn::make('positionData.is_active)->formatStateUsing( function ($record) { $isActive = $record->positionData->sortByDesc('year')->values()->first()->is_active; // render stuff here ... }
But this doesnt seem to be a thing for IconColumns.