@props([ 'createRoute' => null, 'tableHeading', 'createLabel' => 'Add New', 'headers' => [], 'showCreateButton' => true, 'showTableHeading' => false, 'tableSubtitle' => null, 'pagination' => '', 'headerSuffixHtml' => [], 'headerAction' => null, 'headerToolbar' => null, 'tableId' => 'example1', 'paginationClass' => '', 'emptyMessage' => null, 'emptyHint' => null, 'sortColumns' => [], 'perPageSlot' => null, 'filterRow' => null, ]) @php $hasHeaderActions = $headerAction || ($showCreateButton && $createRoute); $showCardHeader = $showTableHeading || $tableSubtitle || $headerToolbar || $hasHeaderActions; @endphp
@if ($showCardHeader)
@if ($showTableHeading || $tableSubtitle)
@if ($showTableHeading)

{{ $tableHeading }}

@endif @if ($tableSubtitle)

{{ $tableSubtitle }}

@endif
@else
Listing
@endif
@if ($headerToolbar)
{!! $headerToolbar !!}
@endif @if ($hasHeaderActions)
@if ($headerAction) {!! $headerAction !!} @elseif ($showCreateButton && $createRoute) {{ $createLabel }} @endif
@endif
@endif
@if (isset($filterSlot))
{!! $filterSlot !!}
@endif
@foreach ($headers as $index => $header) @endforeach @if (isset($filterRow)) {!! $filterRow !!} @endif {{ $slot }}
!empty($sortColumns[$index])]) @if(!empty($sortColumns[$index])) data-sort-col="{{ $sortColumns[$index] }}" @endif> @if($index === 0 && isset($firstHeader)) {!! $firstHeader !!} @else {{ $header }} @endif @if(!empty($headerSuffixHtml[$index] ?? null)) {!! $headerSuffixHtml[$index] !!} @endif
@if (isset($perPageSlot) || isset($paginationSlot) || ! empty($pagination))
@if (isset($perPageSlot))
{!! $perPageSlot !!}
@endif
@endif