Skip to main content
You are currently viewing the documentation for Filament 2.x, which is a previous version of Filament.Looking for the current stable version? Visit the 5.x documentation.
Column classes can be found in the Filament\Tables\Columns namespace. If you’re using the columns in a Livewire component, you can put them in the getTableColumns() method:
If you’re using them in admin panel resources or relation managers, you must put them in the $table->columns() method:
Columns may be created using the static make() method, passing its name. The name of the column should correspond to a column or accessor on your model. You may use “dot syntax” to access columns within relationships.

Available columns

Filament ships with two main types of columns - static and editable. Static columns display data to the user: Editable columns allow the user to update data in the database without leaving the table: You may also create your own custom columns to display data however you wish.

Setting a label

By default, the label of the column, which is displayed in the header of the table, is generated from the name of the column. You may customize this using the label() method:
Optionally, you can have the label automatically translated by using the translateLabel() method:

Sorting

Columns may be sortable, by clicking on the column label. To make a column sortable, you must use the sortable() method:
If you’re using an accessor column, you may pass sortable() an array of database columns to sort by:
You may customize how the sorting is applied to the Eloquent query using a callback:
If a column is sortable(), you may choose to sort it by default using the getDefaultTableSortColumn() and getDefaultTableSortDirection() methods:

Persist sort in session

To persist the sort in the user’s session, override the shouldPersistTableSortInSession() method on the Livewire component:

Searching

Columns may be searchable, by using the text input in the top right of the table. To make a column searchable, you must use the searchable() method:
If you’re using an accessor column, you may pass searchable() an array of database columns to search within:
You may customize how the search is applied to the Eloquent query using a callback:

Searching individually

You can choose to enable a per-column search input using the isIndividual parameter:
If you use the isIndividual parameter, you may still search that column using the main “global” search input for the entire table. To disable that functionality while still preserving the individual search functionality, you need the isGlobal parameter:
You may optionally persist the searches in the query string:

Persist search in session

To persist the table or individual column search in the user’s session, override the shouldPersistTableSearchInSession() or shouldPersistTableColumnSearchInSession() method on the Livewire component:

Cell actions and URLs

When a cell is clicked, you may run an “action”, or open a URL.

Running actions

To run an action, you may use the action() method, passing a callback or the name of a Livewire method to run. Each method accepts a $record parameter which you may use to customize the behaviour of the action:

Action modals

You may open action modals by passing in an Action object to the action() method:
Action objects passed into the action() method must have a unique name to distinguish it from other actions within the table.

Opening URLs

To open a URL, you may use the url() method, passing a callback or static URL to open. Callbacks accept a $record parameter which you may use to customize the URL:
You may also choose to open the URL in a new tab:

Setting a default value

To set a default value for fields with a null state, you may use the default() method:

Hiding columns

To hide a column conditionally, you may use the hidden() and visible() methods, whichever you prefer:

Toggling column visibility

Users may hide or show columns themselves in the table. To make a column toggleable, use the toggleable() method:
By default, toggleable columns are visible. To make them hidden instead:

Calculated state

Sometimes you need to calculate the state of a column, instead of directly reading it from a database column. By passing a callback function to the getStateUsing() method, you can customize the returned state for that column based on the $record:

Tooltips

If you want to use tooltips outside of the admin panel, make sure you have @ryangjchandler/alpine-tooltip installed in your app, including tippy.css. You’ll also need to install tippy.css if you’re using a custom admin theme.
You may specify a tooltip to display when you hover over a cell:
This method also accepts a closure that can access the current table record:

Custom attributes

The HTML of columns can be customized, by passing an array of extraAttributes():
These get merged onto the outer <div> element of each cell in that column.

Global settings

If you wish to change the default behaviour of all columns globally, then you can call the static configureUsing() method inside a service provider’s boot() method, to which you pass a Closure to modify the columns using. For example, if you wish to make all columns sortable() and toggleable(), you can do it like so:
Additionally, you can call this code on specific column types as well:
Of course, you are still able to overwrite this on each column individually: