@php $formatBooleanValue = fn($val) => in_array($val, ['1', 'true', true], true) ? 'Yes' : 'No'; $formatString = function ($value) { // convert \n to
for text area, and skip html special char. $value = nl2br(e($value)); // check for urls and embed anchor tag if (str_starts_with($value, 'http')) { return " $value "; } else { return $value; } }; @endphp

{{ $submission->name ?? $submission->uuid }}

{{ $submission->created_at }}

@foreach ($questions as $questionTitle => $answer)

{{ $questionTitle }}

@php $value = is_string($answer?->rawValues) ? $formatString($answer?->rawValues) : $answer?->rawValues; @endphp @if ($answer?->formElement->type == 'boolean') @elseif($answer?->formElement->type === 'file') @foreach ($value as $file) {{ $file['name'] }} @endforeach @elseif($answer?->formElement->type === 'multipletext') @foreach ($value as $key => $text) @endforeach @elseif(is_array($value)) @else @endif
{{ $questionTitle }} {!! $formatBooleanValue($value) !!}
{{ $key }} {!! $text !!}
{{ $questionTitle }} {{ implode(', ', $value) }}
{{ $questionTitle }} {!! $value !!}
@endforeach