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

Filament\Tables\Columns\Column

Inheritance

Extends: Filament\Support\Components\ViewComponent

Static Methods

make()

Create a new column instance.
public static function make(?string $name = null): static
name
string | null
The column name, typically corresponding to a database column or model attribute. If null, the column class must define getDefaultName().
return
static
Returns the column instance for method chaining.
Example:
use Filament\Tables\Columns\TextColumn;

TextColumn::make('name')
    ->sortable()
    ->searchable();

getDefaultName()

Get the default name for the column.
public static function getDefaultName(): ?string
return
string | null
Returns the default column name or null.

Instance Methods

getTable()

Get the table instance this column belongs to.
public function getTable(): Table
return
Table
Returns the parent table instance.

getState()

Get the current state/value for this column.
public function getState(): mixed
return
mixed
Returns the column value for the current record.

getRecord()

Get the current record.
public function getRecord(): ?Model
return
Model | null
Returns the Eloquent model instance for the current row.

getLivewire()

Get the Livewire component instance.
public function getLivewire(): Component
return
Component
Returns the parent Livewire component.

renderInLayout()

Render the column within a layout (for split layouts).
public function renderInLayout(): ?HtmlString
return
HtmlString | null
Returns the rendered HTML or null if hidden.

Display Methods

label()

Set the column label (header).
public function label(string | Htmlable | Closure | null $label): static
label
string | Htmlable | Closure | null
The column header label.
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('created_at')
    ->label('Date Created');

placeholder()

Set a placeholder when the column value is empty.
public function placeholder(string | Htmlable | Closure | null $placeholder): static
placeholder
string | Htmlable | Closure | null
The placeholder text to display when the value is empty.
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('description')
    ->placeholder('No description');

alignment()

Set the column alignment.
public function alignment(Alignment | string | Closure | null $alignment): static
alignment
Alignment | string | Closure | null
The alignment (start, center, end).
return
static
Returns the column instance for method chaining.
Example:
use Filament\Support\Enums\Alignment;

TextColumn::make('price')
    ->alignment(Alignment::End);

width()

Set the column width.
public function width(string | Closure | null $width): static
width
string | Closure | null
The width (e.g., ‘200px’, ‘20%’).
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('actions')
    ->width('100px');

grow()

Allow the column to grow to fill available space.
public function grow(bool | Closure $condition = true): static
condition
bool | Closure
default:"true"
Whether the column should grow.
return
static
Returns the column instance for method chaining.

Searching and Sorting

searchable()

Make the column searchable.
public function searchable(
    bool | array | Closure $condition = true,
    ?Closure $query = null,
    bool $isIndividual = false
): static
condition
bool | array | Closure
default:"true"
Whether the column is searchable, or an array of searchable database columns.
query
Closure | null
Custom search query callback.
isIndividual
bool
default:"false"
Whether to use individual column search.
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('name')
    ->searchable();

// Search multiple columns
TextColumn::make('name')
    ->searchable(['first_name', 'last_name']);

sortable()

Make the column sortable.
public function sortable(bool | array | Closure $condition = true, ?Closure $query = null): static
condition
bool | array | Closure
default:"true"
Whether the column is sortable, or an array of database columns to sort by.
query
Closure | null
Custom sort query callback.
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('created_at')
    ->sortable();

Actions and URLs

action()

Set an action to trigger when the column is clicked.
public function action(Action | Closure | null $action): static
action
Action | Closure | null
The action to execute or a callback returning an action name.
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('name')
    ->action(fn () => 'edit');

url()

Set a URL for the column.
public function url(string | Closure | null $url, bool | Closure $shouldOpenInNewTab = false): static
url
string | Closure | null
The URL or a callback returning a URL.
shouldOpenInNewTab
bool | Closure
default:"false"
Whether to open the URL in a new tab.
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('website')
    ->url(fn (Model $record) => $record->website, shouldOpenInNewTab: true);

Visibility Control

hidden()

Hide the column based on a condition.
public function hidden(bool | Closure $condition = true): static
Example:
TextColumn::make('internal_notes')
    ->hidden(fn () => ! auth()->user()->isAdmin());

toggleable()

Allow users to toggle column visibility.
public function toggleable(bool | Closure $condition = true, bool | Closure $isToggledHiddenByDefault = false): static
condition
bool | Closure
default:"true"
Whether the column is toggleable.
isToggledHiddenByDefault
bool | Closure
default:"false"
Whether the column is hidden by default.
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('updated_at')
    ->toggleable(isToggledHiddenByDefault: true);

Summarization

summarize()

Add summary calculations to the column.
public function summarize(Summarizer | array | Closure $summarizers): static
summarizers
Summarizer | array | Closure
One or more summarizer instances or a callback returning summarizers.
return
static
Returns the column instance for method chaining.
Example:
use Filament\Tables\Columns\Summarizers\Sum;
use Filament\Tables\Columns\Summarizers\Average;

TextColumn::make('price')
    ->summarize([
        Sum::make(),
        Average::make(),
    ]);

Tooltips

tooltip()

Add a tooltip to the column.
public function tooltip(string | Htmlable | Closure | null $tooltip): static
tooltip
string | Htmlable | Closure | null
The tooltip content.
return
static
Returns the column instance for method chaining.
Example:
TextColumn::make('status')
    ->tooltip(fn (Model $record) => "Last updated: {$record->updated_at}");

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

Build docs developers (and LLMs) love