Skip to content

Getting started

Quick start

Fast Tables makes big Filament tables fast. Filament still renders each row on the server, from your existing table() definition, with the same methods and queries.

This page covers the install and the first table. Settings lists every method, and Licence key covers production hosts.

Requirements

Fast Tables Filament PHP Laravel
1.x 5.9 or later 8.2 or later 11.28 or later

Fast Tables has its own version numbers. They do not follow Filament's version numbers.

Install

Fast Tables is a paid package. It is not on Packagist.

  1. Buy a licence. The purchase email has your Composer repository URL and credentials.
  2. Add the repository and credentials to your project, with the values from the email:
composer config repositories.fast-tables composer REPOSITORY_URL
composer config http-basic.REPOSITORY_HOST USERNAME PASSWORD
  1. Require the package:
composer require fasttables/fast-tables
  1. Put the licence key from the purchase email in .env:
FAST_TABLES_LICENCE=the-key-from-your-purchase-email

Local, test and staging hosts need nothing more. On a production host the plugin activates the key with fasttables.com once, after the first page, and keeps the domain key it gets back; see Licence key.

Composer publishes the browser assets. If a table does not change after an update, run php artisan filament:assets.

Turn it on

Next, add the InteractsWithFastTable trait to the Livewire component that owns the table. For a resource, that is the list page:

use Dhruval\FastTables\Concerns\InteractsWithFastTable;

class ListOrders extends ListRecords
{
    use InteractsWithFastTable;
}

Finally, call fast() on the table:

public static function table(Table $table): Table
{
    return $table
        ->columns([...])
        ->filters([...])
        ->fast();
}

Open the page and scroll: the rows load as you go. A relation manager, a table widget or a custom Livewire table uses the same trait and the same method.

If the trait is missing, Fast Tables throws an exception that names it in the local and testing environments. In production, the native Filament table shows and the log says why.

Every table in a panel

To turn it on for every table in a panel, register the plugin. Each page that owns a table still needs the trait:

use Dhruval\FastTables\FastTablesPlugin;

$panel->plugin(FastTablesPlugin::make()->everyTable());

A table can opt out with ->fast(false).

What is the same

Everything Filament renders:

  • Your columns, custom columns and ViewColumns.
  • The Split, Stack and Panel layouts, and contentGrid() cards.
  • Filters, search, sorting and pagination.
  • Record actions, bulk actions, policies, modals and notifications.
  • Polling and Livewire refreshes.
  • Your theme and your CSS.

Your existing tests keep passing, because the markup is Filament's markup.

Fast Tables works in the layer beneath the table: it changes how the browser carries the rows, so the page holds only the rows on screen. Filament still renders every row, with your own table() definition, so a regular Filament table works by default.

Every default Filament table method has been tested with Fast Tables. If something does not work as it does natively, email [email protected] with the table definition.

Other Filament plugins should work alongside Fast Tables, because they do not manage the rows in the browser. Not every plugin has been tested, and a plugin that replaces the table's rows itself could conflict. Tell us if you find one.

Server-side work such as query tuning, indexes and N+1 fixes is separate from Fast Tables. Do it as well: it speeds up the query, while Fast Tables speeds up the page that shows the result.

Phones and tablets

A stackedOnMobile() table works as in Filament: below the sm breakpoint, each row stacks its cells with their labels. The rows stay fast, and touch scrolling loads more rows as you go.

Fallback

Two tables show the native Filament table instead: a table with its own content() view, and a table with collapsible groups and more than 2,000 groups on one page. Each case is logged once. In the local and testing environments the table throws instead, so you see it while you develop; ->fastStrict(false) turns that off. See fastStrict().

If the page's Content-Security-Policy blocks the Fast Tables script, the native Filament table shows, and a message in the browser console names the directive to allow.

What is different

  • The browser's find in page (Ctrl/Cmd+F) covers the loaded rows only. The table's search field and Filament's global search cover the whole query.
  • Printing (Ctrl/Cmd+P) covers the first 1,000 rows of the page. See printLimit().
  • A card in a column layout loses its focus when it scrolls out of view. A row in a table layout keeps the focus while it is on the page.
  • Cursor pagination works with the queries Laravel's cursor pagination supports. Pages reached with "Previous" are sliced from Filament's page set.