Filament: Complex Table with Multiple Features

Demonstrates many features of Filament Tables: filters, summarizers, sorting, searching, header widgets, etc.

21-complex-table-multiple-features

Get the Source Code:

How it works

The whole table logic is in the OrderResource Filament Resource.

Table tabs are in the ListOrders class. For every tab, we modify the query based on the order status and show the order count for a particular status. Here is what the code to add tabs looks like:

public function getTabs(): array
{
return [
'in_progress' => ListRecords\Tab::make()
->badge(Order::where('status', OrderStatus::IN_PROGRESS->value)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('status', OrderStatus::IN_PROGRESS->value)),
'completed' => ListRecords\Tab::make()
->badge(Order::where('status', OrderStatus::COMPLETED->value)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('status', OrderStatus::COMPLETED->value)),
'canceled' => ListRecords\Tab::make()
->badge(Order::where('status', OrderStatus::CANCELED->value)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('status', OrderStatus::CANCELED->value)),
'priority' => ListRecords\Tab::make()
->badge(Order::where('is_priority', true)->count())
->modifyQueryUsing(fn (Builder $query) => $query->where('is_priority', true)),
];
}

Above the table, we have a widget with three stats cards showing revenue for the current day, the last seven days, and the last 30 days. The widget must be registered in the ListOrders class in the getHeaderWidgets method.

Here is the...

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.
Get the Source Code: All 50 Premium Examples for $99 Only Table Examples for $39