Group table using summarize get row's record
Hi,
How we can get row's record inside summarize in group table?
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');
})
);