Show Empty Table Until Users Search/Filter Data

Filament 3
Also available in Filament 4/5 version

If you have too many records in a single table to show immediately, you can hide them until a filter/search is applied.

FilamentExamples ThumbBase (22)

Get the Source Code:

Only This Example

$9

One-time payment

Full source code for Show Empty Table Until Users Search/Filter Data
Downloadable ZIP file with the source code
Lifetime access to this example
GitHub Sign in with GitHub to buy

Sign in first, then complete your $9 checkout.

Best value — all 172 examples

FilamentExamples Membership

$99 /year
or
$199 lifetime
Access to code of all 172 examples
Future new examples and updates included
FilaCheck Pro package licence included
MCP server included
View membership plans

30-day money-back guarantee

How it works

Let's start by adding tabs functionality to the table. To do this, let's modify our ListOrders file:

app/Filament/Resources/OrderResource/Pages/ListOrders.php

// ...
 
public function getTabs(): array
{
return [
'all' => Tab::make(),
'completed' => Tab::make()
->modifyQueryUsing(fn(Builder $query) => $query->where('status', OrderStatus::Completed->value)),
'refunded' => Tab::make()
->modifyQueryUsing(fn(Builder $query) => $query->where('status', OrderStatus::Refunded->value)),
];
}
 
// ...

Once that is done, let's modify the OrderResource file to add the logic that will prevent the table from displaying any entries unless searched or filtered:

app/Filament/Resources/OrderResource.php

use Illuminate\Database\Eloquent\Builder;
use App\Filament\Resources\OrderResource\Pages\ListOrders;
 
// ...
 
public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(function (Builder $query, ListOrders $livewire) {
// ...
The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.