F
Filament4mo ago
minami

Group table using summarize get row's record

Hi, How we can get row's record inside summarize in group table?
Tables\Columns\TextColumn::make('price')
->label('Price')
->money('USD')
->formatStateUsing(function ($record) {
dd($record); // we can get record in formatStateUsing but how to get in summarize?
})
->summarize(Summarizer::make()
->using(function (Table $table) use ($specific_column) {
return $table->getRecords()->where('group', how to get group from row's record? )->sum('price');
})
);
Tables\Columns\TextColumn::make('price')
->label('Price')
->money('USD')
->formatStateUsing(function ($record) {
dd($record); // we can get record in formatStateUsing but how to get in summarize?
})
->summarize(Summarizer::make()
->using(function (Table $table) use ($specific_column) {
return $table->getRecords()->where('group', how to get group from row's record? )->sum('price');
})
);
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?