@foreach($questions as $question ) @endforeach @foreach($submissions as $submission) @forelse($submission as $key => $data) @empty @endforelse @endforeach
{{ $question }}
@if(is_array($data)) @php $formatted = []; foreach ($data as $rowKey => $row) { $rowParts = []; // Ensure $row is iterable if (is_iterable($row)) { foreach ($row as $colKey => $value) { $rowParts[] = "$colKey: $value"; } $formatted[] = "$rowKey: " . implode(', ', $rowParts); } else { $formatted[] = "$rowKey: $row"; } } @endphp {!! htmlspecialchars(implode(' | ', $formatted)) !!} @else {{ htmlspecialchars($data) }} @endif