Is there a problem with the last release on TextColumn ?

on the hidden or what ever method, when having a closure on a null data, this error happen : Filament\Tables\Columns\Column::hasRelationship(): Argument #1 ($record) must be of type Illuminate\Database\Eloquent\Model, null given,
Tables\Columns\TextColumn::make('site_web')
->formatStateUsing(fn () => 'Site Web')
->icon('icon-web')
->color(Color::Neutral)
->hidden(function (?string $state): bool {return !! $state;}), ...
Tables\Columns\TextColumn::make('site_web')
->formatStateUsing(fn () => 'Site Web')
->icon('icon-web')
->color(Color::Neutral)
->hidden(function (?string $state): bool {return !! $state;}), ...
1 Reply
charlie
charlie4w ago
are you type hinting your model somewhere? If yes, try to make it nullable: fn(YourModel $record) fn(?YourModel $record)

Did you find this page helpful?