© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
12 replies
Jr.Pikong

filament table hidden record null

this is my code , I want to hidden table column with condition
Tables\Columns\TextColumn::make('stok_sp_hd')
                    ->visible(fn (?Model $record) => $record?->category === "PERDANA LITE")
                    ->numeric()
                    ->sortable(),
Tables\Columns\TextColumn::make('stok_sp_hd')
                    ->visible(fn (?Model $record) => $record?->category === "PERDANA LITE")
                    ->numeric()
                    ->sortable(),

the record always null
Solution
So to manage the label, I use a description to clarify the data.

TextColumn::make('stok_1')
    ->getStateUsing(fn (StockDigipos $record): int => $record->category === "PERDANA LITE" ? $record->stok_sp_ld : $record->stok_inj_357)
    ->description(fn (StockDigipos $record): string => $record->category === "PERDANA LITE" ? "Stok SP LD" : "STOK INJ 357"),
TextColumn::make('stok_1')
    ->getStateUsing(fn (StockDigipos $record): int => $record->category === "PERDANA LITE" ? $record->stok_sp_ld : $record->stok_inj_357)
    ->description(fn (StockDigipos $record): string => $record->category === "PERDANA LITE" ? "Stok SP LD" : "STOK INJ 357"),


This explanation highlights the purpose of the
description
description
, emphasizing that it provides clarity regarding the data associated with each label.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

$record is null inside hidden()
FilamentFFilament / ❓┊help
3y ago
$record is null in table
FilamentFFilament / ❓┊help
2y ago
Filament Table column hidden with condition
FilamentFFilament / ❓┊help
3y ago
Table column record parameter for visible & hidden methods
FilamentFFilament / ❓┊help
3y ago