Documentation Index Fetch the complete documentation index at: https://mintlify.com/filamentphp/filament/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Filament’s Table Builder provides a complete solution for displaying, filtering, and managing data in your Laravel applications. Built on top of Eloquent, it offers a powerful PHP-based API with extensive customization options while maintaining simplicity.
Tables are composed of several key components:
Columns - Display data in various formats
Filters - Allow users to scope and search data
Actions - Add interactive buttons and bulk operations
Pagination - Handle large datasets efficiently
Getting started
Define a table using the table() method, which returns a Table instance configured with columns, filters, and actions:
use Filament\Tables\Columns\ IconColumn ;
use Filament\Tables\Columns\ TextColumn ;
use Filament\Tables\ Table ;
public function table ( Table $table ) : Table
{
return $table
-> columns ([
TextColumn :: make ( 'title' )
-> searchable ()
-> sortable (),
TextColumn :: make ( 'author.name' )
-> label ( 'Author' ),
IconColumn :: make ( 'is_featured' )
-> boolean (),
TextColumn :: make ( 'created_at' )
-> dateTime ()
-> sortable (),
])
-> filters ([
// Add filters
])
-> recordActions ([
// Add row actions
]);
}
Defining columns
Columns determine what data appears in each row of your table. Filament includes many prebuilt column types:
Text Column Display text content with formatting, badges, and icons
Icon Column Show icons or boolean states with colors
Image Column Display images with circular, square, or stacked layouts
Color Column Preview color values as swatches
Column basics
Create columns using the static make() method with the attribute name:
use Filament\Tables\Columns\ TextColumn ;
TextColumn :: make ( 'title' )
Accessing relationships
Use dot notation to display data from Eloquent relationships:
TextColumn :: make ( 'author.name' )
TextColumn :: make ( 'category.parent.name' )
Filament automatically eager-loads these relationships for optimal performance.
Making columns sortable
Enable sorting by clicking column headers:
TextColumn :: make ( 'title' )
-> sortable ()
Making columns searchable
Add a search field to filter by column content:
TextColumn :: make ( 'title' )
-> searchable ()
You can make multiple columns searchable - the search will match any of them.
Tables are paginated by default with options for 5, 10, 25, and 50 records per page.
public function table ( Table $table ) : Table
{
return $table
-> paginated ([ 10 , 25 , 50 , 100 , 'all' ]);
}
Setting default page size
public function table ( Table $table ) : Table
{
return $table
-> defaultPaginationPageOption ( 25 );
}
use Filament\Tables\Enums\ PaginationMode ;
public function table ( Table $table ) : Table
{
return $table
-> paginationMode ( PaginationMode :: Simple );
}
use Filament\Tables\Enums\ PaginationMode ;
public function table ( Table $table ) : Table
{
return $table
-> paginationMode ( PaginationMode :: Cursor );
}
public function table ( Table $table ) : Table
{
return $table
-> paginated ( false );
}
Clickable rows
Make entire rows clickable using the recordUrl() method:
use Illuminate\Database\Eloquent\ Model ;
public function table ( Table $table ) : Table
{
return $table
-> recordUrl (
fn ( Model $record ) : string => route ( 'posts.edit' , [ 'record' => $record ]),
);
}
Open URLs in a new tab:
public function table ( Table $table ) : Table
{
return $table
-> openRecordUrlInNewTab ();
}
Reordering records
Allow drag-and-drop reordering with a sort column:
public function table ( Table $table ) : Table
{
return $table
-> reorderable ( 'sort' );
}
The sort column stores the order. Users can toggle reordering mode with a button.
Descending order
public function table ( Table $table ) : Table
{
return $table
-> reorderable ( 'sort' , direction : 'desc' );
}
Styling table rows
Striped rows
public function table ( Table $table ) : Table
{
return $table
-> striped ();
}
Conditional row classes
use App\Models\ Post ;
public function table ( Table $table ) : Table
{
return $table
-> recordClasses ( fn ( Post $record ) => match ( $record -> status ) {
'draft' => 'draft-post-table-row' ,
'reviewing' => 'reviewing-post-table-row' ,
'published' => 'published-post-table-row' ,
default => null ,
});
}
Add a heading and description:
public function table ( Table $table ) : Table
{
return $table
-> heading ( 'Clients' )
-> description ( 'Manage your clients here.' )
-> columns ([
// ...
]);
}
Polling content
Automatically refresh table data at intervals:
public function table ( Table $table ) : Table
{
return $table
-> poll ( '10s' );
}
Deferred loading
Load table data asynchronously for better initial page performance:
public function table ( Table $table ) : Table
{
return $table
-> deferLoading ();
}
Global settings
Configure default behavior for all tables in a service provider:
use Filament\Tables\Enums\ FiltersLayout ;
use Filament\Tables\ Table ;
Table :: configureUsing ( function ( Table $table ) : void {
$table
-> reorderableColumns ()
-> filtersLayout ( FiltersLayout :: AboveContentCollapsible )
-> paginationPageOptions ([ 10 , 25 , 50 ]);
});
Next steps
Columns Learn about all available column types and customization options
Filters Add powerful filtering capabilities to your tables
Actions Implement row actions, bulk actions, and header actions