Skip to main content
The 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.
Example:

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.
Example:

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.
Example:

alignment()

Set the column alignment.
Alignment | string | Closure | null
The alignment (start, center, end).
static
Returns the column instance for method chaining.
Example:

width()

Set the column width.
string | Closure | null
The width (e.g., ‘200px’, ‘20%’).
static
Returns the column instance for method chaining.
Example:

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.
Example:

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.
Example:

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.
Example:

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.
Example:

Visibility Control

hidden()

Hide the column based on a condition.
Example:

toggleable()

Allow users to toggle column visibility.
bool | Closure
default:"true"
Whether the column is toggleable.
bool | Closure
default:"false"
Whether the column is hidden by default.
static
Returns the column instance for method chaining.
Example:

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.
Example:

Tooltips

tooltip()

Add a tooltip to the column.
string | Htmlable | Closure | null
The tooltip content.
static
Returns the column instance for method chaining.
Example:

Traits

The Column class uses multiple traits for functionality:
  • BelongsToGroup - Column group relationship
  • BelongsToLayout - Layout relationship
  • BelongsToTable - Table relationship
  • CanAggregateRelatedModels - Relationship aggregation
  • CanBeDisabled - Disability control
  • CanBeHidden - Visibility control
  • CanBeInline - Inline display
  • CanBeSearchable - Search functionality
  • CanBeSortable - Sorting functionality
  • CanBeSummarized - Summary calculations
  • CanBeToggled - Toggle visibility
  • CanCallAction - Action triggering
  • CanGrow - Growth control
  • CanOpenUrl - URL handling
  • CanSpanColumns - Column spanning
  • CanWrapHeader - Header wrapping
  • HasAlignment - Alignment control
  • HasCellState - Cell state management
  • HasExtraAttributes - Extra HTML attributes
  • HasExtraCellAttributes - Cell-specific attributes
  • HasExtraHeaderAttributes - Header-specific attributes
  • HasLabel - Label configuration
  • HasName - Name configuration
  • HasPlaceholder - Placeholder support
  • HasRecord - Record access
  • HasRowLoopObject - Row loop access
  • HasTooltip - Tooltip support
  • HasVerticalAlignment - Vertical alignment
  • HasWidth - Width control
  • InteractsWithTableQuery - Query interaction