{{ $submittedForm->form->title }}
{{ $submittedForm->created_by }}
{{ $submittedForm->id_form }}
{{ $submittedForm->form_status->title ?? 'N/A' }}
{{ $section->title }}
{{ $answers->first()->value ?? 'No answer provided' }}
@break @case('select') @case('radio') @case('dropdown'){{ $answers->first()->value ?? 'No answer provided' }}
@break @case('checkbox') @if ($answers->isNotEmpty())-
@foreach ($answers as $answer)
- {{ $answer->value }} @endforeach
No answer provided
@endif @break @case('file') @if ($answers->first()) @php // Assuming the 'value' contains a JSON object with 'original' and 'unique' keys. $fileData = json_decode( $answers->first()->value, true, ); // Decoding the JSON to get an array $originalFilePath = $fileData['original'] ?? null; // Access the 'original' file path @endphp @if ($originalFilePath) View File @elseNo original file uploaded
@endif @elseNo file uploaded
@endif @break @case('custom_ui')| Commodity | Crop Type | Planted Area (ha) |
|---|---|---|
| {{ $crop }} | {{ $submittedForm->form_answer->where('id_form_question', $questionId)->pluck('value')->first() ?? 'No answer provided' }} | {{ $submittedForm->form_answer->where('id_form_question', $questionId)->pluck('value')->skip(1)->first() ?? 'No answer provided' }} |
Total Planted Area: {{ $submittedForm->form_answer->firstWhere('id_form_question', $question->id)->value ?? 'Not provided' }} ha
@break @defaultUnknown question type
@endswitch