Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

anonymouse703's avatar

How to custom filament v3 widget table?

I have this data from cache

$dashboardData = new DashboardData();
$data = $dashboardData->retrieve();

 $todayData = $data->get('most_sold_series');

how to pass the in the query? or should I change the whole structure?

  public function table(Table $table): Table
    {
        return $table
         ->query(
                 // ...
             )
         ->columns([
                // ...
        ]);
}
0 likes
2 replies
iamjohndev's avatar
use Filament\Tables\Table;
use Illuminate\Support\Collection;
use Filament\Tables\Columns\TextColumn;

public function table(Table $table): Table
{
    // Fetch cached data
    $dashboardData = new DashboardData();
    $data = $dashboardData->retrieve();

    // Convert cached data to collection
    $todayData = collect($data->get('most_sold_series'));

    return $table
        ->query(fn () => $todayData) // Use collection as query source
        ->columns([
         
        ]);
}
anonymouse703's avatar

@iamjohndev

I tried already but not working sir, I got error Method Illuminate\Support\Collection::clone does not exist.

Please or to participate in this conversation.