@props([ 'href', 'recordtype', 'fieldid', 'contenttype', 'recordid', 'value' => '', 'listoptions' => null, 'conditionals' => null ])
@switch($contenttype) @case('free_form_text') @if(isset($href)) @else @endif @break @case('hyperlink') @if($value) @else -- @endif @break @case('date') @break @case('date_time') @break @case('check_box') @break @case('multiple_select')
@php $multilistoptions = is_string($listoptions) ? json_decode($listoptions, true) : $listoptions; if (is_string($multilistoptions) && json_last_error() !== JSON_ERROR_NONE) { $multilistoptions = explode(',', $multilistoptions); } $valueArray = explode(',', $value); $matchingOptions = array_filter($multilistoptions, function($option) use ($valueArray) { return in_array($option['id'], $valueArray); }); @endphp @foreach ($matchingOptions as $index => $option) {{ $option['value'] }}@if($index < count($matchingOptions) - 1), @endif @endforeach --
@break @case('list')
@foreach (json_decode($listoptions) as $option) {{ $option->value }} @endforeach --
@break @endswitch
@switch($contenttype) @case('free_form_text') @break @case('date') @break @case('date_time') @break @case('hyperlink') @break @endswitch