@inject('actionRulesClass', 'PowerComponents\LivewirePowerGrid\Components\Rules\RulesController') @include('livewire-powergrid::components.table.tr') @include('livewire-powergrid::components.table.tr', ['loading' => true]) @if ($this->hasColumnFilters) @include('livewire-powergrid::components.inline-filters') @endif @if (is_null($data) || count($data) === 0) @include('livewire-powergrid::components.table.th-empty') @else @includeWhen($headerTotalColumn, 'livewire-powergrid::components.table-header') @foreach ($data as $row) @if (!isset($row->{$checkboxAttribute}) && $checkbox) @php throw new Exception('To use checkboxes, you must define a unique key attribute in your data source.') @endphp @endif @php $rowId = data_get($row, $primaryKey); $class = $theme->table->trBodyClass; $rulesValues = $actionRulesClass->recoverFromAction($row, 'pg:rows'); $applyRulesLoop = true; $trAttributesBag = new \Illuminate\View\ComponentAttributeBag(); $trAttributesBag = $trAttributesBag->merge(['class' => $class]); if (method_exists($this, 'actionRules')) { $applyRulesLoop = $actionRulesClass->loop($this->actionRules($row), $loop); } if (filled($rulesValues['setAttributes']) && $applyRulesLoop) { foreach ($rulesValues['setAttributes'] as $rulesAttributes) { $trAttributesBag = $trAttributesBag->merge([ $rulesAttributes['attribute'] => $rulesAttributes['value'], ]); } } @endphp @if (isset($setUp['detail'])) @include('livewire-powergrid::components.row', ['rowIndex' => $loop->index + 1]) @include('livewire-powergrid::components.table.detail') @else @include('livewire-powergrid::components.row', ['rowIndex' => $loop->index + 1]) @endif @includeWhen(isset($setUp['responsive']), 'livewire-powergrid::components.expand-container') @endforeach @includeWhen($footerTotalColumn, 'livewire-powergrid::components.table-footer') @endif