$record is null inside hidden()

$table->columns([
TextColumn::make('url')
->url(fn($record) => $record->url) // working
->hidden(fn($record) => $record->url), // null
]),
$table->columns([
TextColumn::make('url')
->url(fn($record) => $record->url) // working
->hidden(fn($record) => $record->url), // null
]),
Is this expected behavior? Or I am doing something wrong?
2 Replies
Dennis Koch
Dennis Koch2y ago
It’s expected because there is no sense on hiding columns based on the record. That would break the table layout
Sebastiaan
Sebastiaan2y ago
I had this question too. I wanted to only show the deleted_at column only on trashed records. I now fixed it by getting the active filters in the ->visible or ->hidden methods
Want results from more Discord servers?
Add your server