FilamentF
Filament14mo ago
btx

getStateUsing() called 3 times on first load

Hey there,
I just investigated some performance issues and noticed that each table that uses getStateUsing() has this function 3 times called on loading the table. So each query inside gets also executed 3 times! Why?
Simple Example:
Tables\Columns\TextColumn::make('products')
   ->label('Products')
   ->badge()
   ->getStateUsing(function (Domain $domain) {
      \Log::debug('DomainResource::table::getStateUsing');
      return $domain->products()->count();
   })
,
image.png
Was this page helpful?