@props([ 'columns' => [], 'rows' => [], 'sortBy' => '', 'sortDir' => 'asc', 'emptyMessage' => '', 'ajaxSort' => false, ]) @php $resolvedEmptyMessage = $emptyMessage ?: __('pages/admin/components.tables.empty.no_records'); $wrap = 'overflow-x-auto rounded-xl border border-border'; $table = 'w-full text-start text-sm text-muted-foreground'; $thead = 'bg-brand text-xs font-semibold uppercase tracking-wider text-brand-foreground'; $th = 'px-6 py-4'; $tr = 'border-t border-border bg-card transition-colors duration-150 hover:bg-muted/60 dark:hover:bg-muted/40'; $td = 'px-6 py-4 text-foreground'; @endphp
merge(['class' => $wrap]) }}> @foreach($columns as $col) @endforeach @if(isset($actions)) @endif @isset($tbody) {{ $tbody }} @else @forelse($rows as $row) @foreach($columns as $col) @endforeach @if(isset($actions)) @endif @empty @endforelse @endisset
$ajaxSort && ($col['sortable'] ?? false), ]) > @if($col['sortable'] ?? false) @if($ajaxSort) {{ $col['label'] }} @else {{ $col['label'] }} @endif @else {{ $col['label'] }} @endif Actions
{{ data_get($row, $col['key']) }} {{ $actions }}