{{-- Response Detail

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

Response from {{ $response->user->name ?? 'Anonymous' }} - {{ $response->submitted_at }}

@php $decodedAnswers = json_decode($response->answers, true); @endphp @if (is_array($decodedAnswers)) @foreach ($decodedAnswers as $questionId => $answer)

Question {{ $questionId }}:

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

@endforeach @else

No valid responses available.

@endif
--}} {{-- Response Detail

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

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

@foreach ($responses as $response)

Question {{ $response->question_id }}:

@php $decodedAnswers = json_decode($response->answers, true); @endphp

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

@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]; $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