Skip to main content
You are currently viewing the documentation for Filament 1.x, which is a previous version of Filament.Looking for the current stable version? Visit the 5.x documentation.
Filament includes a table builder which can be used to create interactive tables in the admin panel. Tables have columns and filters, which are defined in two methods on the table object. Here is an example table configuration for a CustomerResource:

Columns

Resource column classes are located in the Filament\Resources\Tables\Columns namespace. All columns have access to the following customization methods:
Since sorting and searching are done by the database, sortable() and searchable() will not be fully functional when using a custom getValueUsing() callback.

Displaying Relationship Data

You set up columns that display results from a related model using dot syntax in its name:
This would check for a customer relationship on the parent model and output the related customerโ€™s name.

Calling Actions

You may want something to happen when a cell is clicked. Usually, this is opening a URL, or running a custom Livewire action. To open a URL when a cell is clicked, a callback is used to generate the destination. For example:
Cells of the above column will display the contents of the recordโ€™s website, and redirect the user to it when they click. The second parameter to url(), true, means that the website will open in a new tab when clicked. Alternatively, you may specify a custom Livewire action that should run when the column is clicked. The primary key of the clicked record will be passed as a parameter to the action:
Cells of the above column will call the editUsername() Livewire action when clicked.

Boolean

The trueIcon() and falseIcon() methods support the name of any Blade icon component, and passes a set of formatting classes to it. By default, the Blade Heroicons package is installed, so you may use the name of any Heroicon out of the box. However, you may create your own custom icon components or install an alternative library if you wish.

Icon

The options() method supports the names of any Blade icon components, and passes a set of formatting classes to them. By default, the Blade Heroicons package is installed, so you may use the name of any Heroicon out of the box. However, you may create your own custom icon components or install an alternative library if you wish.
Here is an example usage of this column:

Image

Text

Other column types are coming soon.

Developing Custom Column Types

To create a new column type, which may be used in any table, you may generate a class and cell view using:
Alternatively, simple custom columns may be created using a View component, and passing the name of a cell $view in your app:

Filters

Filters are used to scope results in the table. Here is an example of a filter at allows only customers with a type of individual to be shown in the table:
They have access to the following customization options:
You can define a default filter to be applied when no other filter is selected by the user by calling defaultFilter() on the Table object:

Reusable Filters

You may wish to create a filter that you may reuse across multiple tables. To create a reusable filter, you may use the following command:
This will create a new filter in the app/Filament/Resources/Tables/Filters directory:
You may modify the filterโ€™s query in the apply() method of that class:
Currently, filters are static and only one may be applied at a time. Parameter-based filters and support for applying multiple filters at once is coming soon.

Context Customization

You may customize tables based on the page they are used. To do this, you can chain the only() or except() methods onto any column or filter.
In this example, the individuals filter will only() be available on the ListCustomers page.
In this example, the name column will be primary, except() on the ListCustomers page. This is an incredibly powerful pattern, and allows you to completely customize a table contextually by chaining as many methods as you wish to the callback.