@php // Default to empty array if not passed $excludedColumns = $excludedColumns ?? []; // Dynamically extract columns, excluding the passed ones $columns = $items->flatMap(fn($row) => array_keys($row->toArray())) ->unique() ->reject(fn($col) => in_array($col, $excludedColumns)) ->toArray(); @endphp {{-- Dynamic Table --}}
{{ $label }} |
@endforeach
---|
{{ $row[$column] ?? 'N/A' }} | @endforeach