Column class is the foundation for all table column components in Filament. It provides functionality for displaying data, sorting, searching, and interacting with table records.
Namespace
Inheritance
Extends:Filament\Support\Components\ViewComponent
Static Methods
make()
Create a new column instance.The column name, typically corresponding to a database column or model attribute. If
null, the column class must define getDefaultName().Returns the column instance for method chaining.
getDefaultName()
Get the default name for the column.Returns the default column name or
null.Instance Methods
getTable()
Get the table instance this column belongs to.Returns the parent table instance.
getState()
Get the current state/value for this column.Returns the column value for the current record.
getRecord()
Get the current record.Returns the Eloquent model instance for the current row.
getLivewire()
Get the Livewire component instance.Returns the parent Livewire component.
renderInLayout()
Render the column within a layout (for split layouts).Returns the rendered HTML or
null if hidden.Display Methods
label()
Set the column label (header).The column header label.
Returns the column instance for method chaining.
placeholder()
Set a placeholder when the column value is empty.The placeholder text to display when the value is empty.
Returns the column instance for method chaining.
alignment()
Set the column alignment.The alignment (start, center, end).
Returns the column instance for method chaining.
width()
Set the column width.The width (e.g., ‘200px’, ‘20%’).
Returns the column instance for method chaining.
grow()
Allow the column to grow to fill available space.Whether the column should grow.
Returns the column instance for method chaining.
Searching and Sorting
searchable()
Make the column searchable.Whether the column is searchable, or an array of searchable database columns.
Custom search query callback.
Whether to use individual column search.
Returns the column instance for method chaining.
sortable()
Make the column sortable.Whether the column is sortable, or an array of database columns to sort by.
Custom sort query callback.
Returns the column instance for method chaining.
Actions and URLs
action()
Set an action to trigger when the column is clicked.The action to execute or a callback returning an action name.
Returns the column instance for method chaining.
url()
Set a URL for the column.The URL or a callback returning a URL.
Whether to open the URL in a new tab.
Returns the column instance for method chaining.
Visibility Control
hidden()
Hide the column based on a condition.toggleable()
Allow users to toggle column visibility.Whether the column is toggleable.
Whether the column is hidden by default.
Returns the column instance for method chaining.
Summarization
summarize()
Add summary calculations to the column.One or more summarizer instances or a callback returning summarizers.
Returns the column instance for method chaining.
Tooltips
tooltip()
Add a tooltip to the column.The tooltip content.
Returns the column instance for method chaining.
Traits
The Column class uses multiple traits for functionality:BelongsToGroup- Column group relationshipBelongsToLayout- Layout relationshipBelongsToTable- Table relationshipCanAggregateRelatedModels- Relationship aggregationCanBeDisabled- Disability controlCanBeHidden- Visibility controlCanBeInline- Inline displayCanBeSearchable- Search functionalityCanBeSortable- Sorting functionalityCanBeSummarized- Summary calculationsCanBeToggled- Toggle visibilityCanCallAction- Action triggeringCanGrow- Growth controlCanOpenUrl- URL handlingCanSpanColumns- Column spanningCanWrapHeader- Header wrappingHasAlignment- Alignment controlHasCellState- Cell state managementHasExtraAttributes- Extra HTML attributesHasExtraCellAttributes- Cell-specific attributesHasExtraHeaderAttributes- Header-specific attributesHasLabel- Label configurationHasName- Name configurationHasPlaceholder- Placeholder supportHasRecord- Record accessHasRowLoopObject- Row loop accessHasTooltip- Tooltip supportHasVerticalAlignment- Vertical alignmentHasWidth- Width controlInteractsWithTableQuery- Query interaction