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.string | null
The column name, typically corresponding to a database column or model attribute. If
null, the column class must define getDefaultName().static
Returns the column instance for method chaining.
getDefaultName()
Get the default name for the column.string | null
Returns the default column name or
null.Instance Methods
getTable()
Get the table instance this column belongs to.Table
Returns the parent table instance.
getState()
Get the current state/value for this column.mixed
Returns the column value for the current record.
getRecord()
Get the current record.Model | null
Returns the Eloquent model instance for the current row.
getLivewire()
Get the Livewire component instance.Component
Returns the parent Livewire component.
renderInLayout()
Render the column within a layout (for split layouts).HtmlString | null
Returns the rendered HTML or
null if hidden.Display Methods
label()
Set the column label (header).string | Htmlable | Closure | null
The column header label.
static
Returns the column instance for method chaining.
placeholder()
Set a placeholder when the column value is empty.string | Htmlable | Closure | null
The placeholder text to display when the value is empty.
static
Returns the column instance for method chaining.
alignment()
Set the column alignment.Alignment | string | Closure | null
The alignment (start, center, end).
static
Returns the column instance for method chaining.
width()
Set the column width.string | Closure | null
The width (e.g., ‘200px’, ‘20%’).
static
Returns the column instance for method chaining.
grow()
Allow the column to grow to fill available space.bool | Closure
default:"true"
Whether the column should grow.
static
Returns the column instance for method chaining.
Searching and Sorting
searchable()
Make the column searchable.bool | array | Closure
default:"true"
Whether the column is searchable, or an array of searchable database columns.
Closure | null
Custom search query callback.
bool
default:"false"
Whether to use individual column search.
static
Returns the column instance for method chaining.
sortable()
Make the column sortable.bool | array | Closure
default:"true"
Whether the column is sortable, or an array of database columns to sort by.
Closure | null
Custom sort query callback.
static
Returns the column instance for method chaining.
Actions and URLs
action()
Set an action to trigger when the column is clicked.Action | Closure | null
The action to execute or a callback returning an action name.
static
Returns the column instance for method chaining.
url()
Set a URL for the column.string | Closure | null
The URL or a callback returning a URL.
bool | Closure
default:"false"
Whether to open the URL in a new tab.
static
Returns the column instance for method chaining.
Visibility Control
hidden()
Hide the column based on a condition.toggleable()
Allow users to toggle column visibility.bool | Closure
default:"true"
Whether the column is toggleable.
Whether the column is hidden by default.
static
Returns the column instance for method chaining.
Summarization
summarize()
Add summary calculations to the column.Summarizer | array | Closure
One or more summarizer instances or a callback returning summarizers.
static
Returns the column instance for method chaining.
Tooltips
tooltip()
Add a tooltip to the column.string | Htmlable | Closure | null
The tooltip content.
static
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