@props([ 'href', 'recordtype', 'fieldid', 'contenttype', 'recordid', 'value' => '', 'label' => '', 'required' => false, 'listoptions' => null ])
@switch($contenttype) @case('free_form_text') @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 Select
@break @case('list')
Select
@break @endswitch