{{-- Response Detail

{{ $form->title }} - Response Detail

Response from {{ $responses->first()->user->name ?? 'Anonymous' }} - {{ $responses->first()->submitted_at }}

@foreach ($responses as $response) @php $question = $questions[$response->question_id]; $decodedAnswers = json_decode($response->answers, true); @endphp

{{ $question->question_text }}

@if ($question->type == 'multiple_choice' || $question->type == 'checkbox' || $question->type == 'dropdown') @foreach (json_decode($question->options) as $option)

{{ $option }}

@endforeach @else

{{ is_array($decodedAnswers) ? implode(', ', $decodedAnswers) : $decodedAnswers }}

@endif
@endforeach
--}} Response Detail

{{ $form->title }} - Response Detail

Response from {{ $responses->first()->user->name ?? 'Anonymous' }} - {{ $responses->first()->submitted_at }}

@foreach ($responses as $response) @php $question = $questions[$response->question_id] ?? null; $decodedAnswers = json_decode($response->answers, true); @endphp @if ($question)

{{ $question->question_text }}

@if ($question->type == 'dropdown') @elseif (in_array($question->type, ['multiple_choice', 'checkbox'])) @foreach (json_decode($question->options) as $option)

{{ $option }}

@endforeach @else

{{ is_array($decodedAnswers) ? implode(', ', $decodedAnswers) : $decodedAnswers }}

@endif
@else

Question not found for ID: {{ $response->question_id }}

@endif @endforeach