You are viewing the Filament 3 docs (TableKit ^3.0). Using Filament 5? Open the latest version of this page.

On this page

TableKit for Filament 3

Saved views and power tools for Filament tables.

TableKit in a Filament Orders table: a favorites bar of saved views (All orders, Needs attention, High value, Top accounts, Save view) above the table, with sort, filter and search controls.

Watch the full demo on YouTube (77 s, with sound)

Website and full documentation: https://maytham553.github.io/filament-tablekit/

TableKit (tablekit/filament-tablekit) lets your users save the state of a table as a named view and open it again in one click. A bar above the table shows their favorite views. You can also ship ready-made views of your own.

You are reading the docs for Filament 3. See Which version? for the other branches.

What you get#

  • Saved views: save filters, search, column searches, sort, visible columns, column order and grouping under a name.
  • Preset views: views you define in code, with an optional hidden query, a badge and a tooltip.
  • View manager: a list to open, favorite, reorder, edit, delete and mark views as default.
  • Default view: each user can pick one start view per table, and you can set a default in code.
  • Multi-sort: sort by several columns, with a priority for each.
  • Quick filters: clickable filter chips, with favorite filters that stay visible.
  • Column order: reorder columns by drag and drop, and save the order in views.
  • Color and icon pickers: about 120 icons and 24 colors for your views.
  • RTL and translations: English and Arabic included.
  • Multi-tenancy: views are scoped by user, table and tenant.

Which version?#

Use the TableKit version that matches your Filament version. Composer picks it for you from the Filament you have installed.

Filament Livewire TableKit Branch Laravel
5 4 ^5.0 main 11.28+, 12, 13
4 3 ^4.0 filament-v4 11.28+, 12, 13
3 3 ^3.0 filament-v3 11.28+, 12

All versions need PHP 8.2 or newer.

Installation#

You need an existing Filament 3 panel.

  1. Install the package.

    composer require tablekit/filament-tablekit

    Not on Packagist yet, or want a branch? See Install from GitHub.

    Laravel 11 currently has Composer security advisories. Upgrade Laravel, or see Installation.

  2. Run the migrations. They load by themselves. If your app owns its migrations, see Database.

    php artisan migrate
  3. Add the trait to a list page, a relation manager or a table widget, for example app/Filament/Resources/OrderResource/Pages/ListOrders.php.

    use TableKit\Concerns\HasTableKit;
    
    class ListOrders extends ListRecords
    {
        use HasTableKit;
    }

    Open the table. The bar with Default and Save view is now above it. No theme or CSS step is needed.

  4. Optional: register the plugin in your panel provider (app/Providers/Filament/AdminPanelProvider.php, inside panel()). You only need it to change options. Everything works without it.

    use TableKit\TableKitPlugin;
    
    $panel->plugin(TableKitPlugin::make());

Your first preset#

Return presets from the same class. Make the method protected. This one assumes a status filter and a sortable ordered_at column. A filter or column that does not exist is ignored.

use TableKit\Presets\PresetTableView;

protected function getPresetTableViews(): array
{
    return [
        'shipped' => PresetTableView::make()
            ->label('Shipped')
            ->icon('truck')
            ->color('success')
            ->favorite()
            ->defaultFilters(['status' => ['value' => 'shipped']])
            ->defaultSort('ordered_at', 'desc'),
    ];
}

Documentation#

Page What is in it
Installation Composer, GitHub, publish tags
Configuration Every config key and plugin option
Views Saved views, the bar, the manager, defaults, reload and the URL
Presets Every preset method, with examples
Multi-sort Sort by several columns
Quick filters Filter chips and favorite filters
Columns Column order in views and presets
Colors and icons Pickers, icon aliases, Tabler remap, translations
Database Tables, connection, tenancy, user keys, stored state
Limits Known limits
Testing Livewire test examples
Upgrading Upgrade notes

Security and privacy#

  • A preset's hidden query is a filter, not access control. Users can drop it at any time. Put real rules in your resource query, policies or global scopes.
  • A view stores the search text and filter values the user typed. This can be personal data. Views are not deleted with the user, so delete them when you delete the account. See Database.
  • The server checks ownership on every action. View ids and preset keys that come from the browser are checked again on the server.
  • Views are scoped by user type, user id, tenant and table. Users never see each other's views.

License#

MIT. See LICENSE.

Docs for Filament 3. Also available for Filament 5, Filament 4. Edit this page on GitHub.