FilamentF
Filament7mo ago
Asmit

Please help, Record not resolved in visible() method of a SelectColumn

I’m trying to conditionally show a column based on the current record like this:
SelectColumn::make('car_color')
    ->label('Colors')
    ->options(CarColors::class)
    ->sortable()
    ->visible(function (Car $record) {
        dd($record);
    }),

But the dd($record) inside the visible() callback never gets triggered, and it seems like the $record is not being resolved at all.

Is visible() supposed to have access to the record for SelectColumn, or is it evaluated globally (i.e., not per record)?

Would love some clarification on this. Thanks!
Was this page helpful?