Calculate summarize from others summarize
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->label('Name'),
Tables\Columns\TextColumn::make('id')
->label('Id'),
Tables\Columns\TextColumn::make('bet')
->label('Bet')
->summarize([
Sum::make()->label('')
])
->money('EUR')
->color('success'),
Tables\Columns\TextColumn::make('win')
->label('Win')
->money('EUR')
->color('danger')
->summarize([
Sum::make()->label('')
]),
Tables\Columns\TextColumn::make('result')
->label('Result')
->money('EUR')
->color(function ($state) {
if($state > 0) {
return 'success';
}
return 'danger';
})
->summarize([
Sum::make()->label('')
]),
Tables\Columns\TextColumn::make('rtp')
->numeric(decimalPlaces: 2)
->formatStateUsing(function ($record) {
return number_format($record->rtp,2,'.').' %';
})
->summarize()->label(''))
->label('RTP')
->color('success'),
])
return $table
->columns([
Tables\Columns\TextColumn::make('name')
->label('Name'),
Tables\Columns\TextColumn::make('id')
->label('Id'),
Tables\Columns\TextColumn::make('bet')
->label('Bet')
->summarize([
Sum::make()->label('')
])
->money('EUR')
->color('success'),
Tables\Columns\TextColumn::make('win')
->label('Win')
->money('EUR')
->color('danger')
->summarize([
Sum::make()->label('')
]),
Tables\Columns\TextColumn::make('result')
->label('Result')
->money('EUR')
->color(function ($state) {
if($state > 0) {
return 'success';
}
return 'danger';
})
->summarize([
Sum::make()->label('')
]),
Tables\Columns\TextColumn::make('rtp')
->numeric(decimalPlaces: 2)
->formatStateUsing(function ($record) {
return number_format($record->rtp,2,'.').' %';
})
->summarize()->label(''))
->label('RTP')
->color('success'),
])
0 Replies