@props([ 'theme' => null, 'data' => null, 'actions' => null, 'checkbox' => null, 'primaryKey' => null, 'columns' => null, 'currentTable' => null, 'withoutPaginatedData' => null, ]) @if($checkbox) @endif @foreach ($columns as $column) @php if (filled($column->dataField) && str_contains($column->dataField, '.')) { $field = $column->field; } else if (filled($column->dataField) && !str_contains($column->dataField, '.')) { $field = $column->dataField; } else { $field = $column->field; } @endphp @if ($column->count['footer']) {{ $column->count['label'] }}: {{ $withoutPaginatedData->collect()->reject(function($data) use($field) { return empty($data->{$field} ?? $data[$field]); })->count($field) }}
@endif @if ($column->sum['footer'] && is_numeric($withoutPaginatedData[0][$field])) {{ $column->sum['label'] }}: {{ round($withoutPaginatedData->collect()->sum($field), $column->sum['rounded']) }}
@endif @if ($column->avg['footer'] && is_numeric($withoutPaginatedData[0][$field])) {{ $column->avg['label'] }}: {{ round($withoutPaginatedData->collect()->avg($field), $column->avg['rounded']) }}
@endif @if ($column->min['footer'] && is_numeric($withoutPaginatedData[0][$field])) {{ $column->min['label'] }}: {{ round($withoutPaginatedData->collect()->min($field), $column->min['rounded']) }}
@endif @if ($column->max['footer'] && is_numeric($withoutPaginatedData[0][$field])) {{ $column->max['label'] }}: {{ round($withoutPaginatedData->collect()->max($field), $column->max['rounded']) }}
@endif @endforeach @if(isset($actions) && count($actions)) @endif