diff --git a/src/Stubs/Page/Index/Table/Summaries/Sum.php b/src/Stubs/Page/Index/Table/Summaries/Sum.php index dd1dc0aa..1a81b08d 100644 --- a/src/Stubs/Page/Index/Table/Summaries/Sum.php +++ b/src/Stubs/Page/Index/Table/Summaries/Sum.php @@ -11,7 +11,10 @@ class Sum extends Base public function getShouldGenerate(): bool { - return true; -// return $this->getResourceTableColumnsWithSummarizers($this->resource)->isNotEmpty(); + return $this->getResourceTableColumnsWithSummarizers($this->resource) + ->filter(fn($column) => collect($column->getSummarizers()) + ->filter(fn($summarizer) => $summarizer::class === \Filament\Tables\Columns\Summarizers\Sum::class) + ->count()) + ->isNotEmpty(); } }