From: Vincent Vanwaelscappel Date: Fri, 28 Oct 2022 15:11:53 +0000 (+0200) Subject: wip #5468 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4206caef50e4a2b8d543ac6825405f2232f495a5;p=cubist_cms-back.git wip #5468 --- diff --git a/src/resources/views/fields/select2_from_array.blade.php b/src/resources/views/fields/select2_from_array.blade.php index a04b178..da87ff6 100644 --- a/src/resources/views/fields/select2_from_array.blade.php +++ b/src/resources/views/fields/select2_from_array.blade.php @@ -48,11 +48,24 @@ if($ajax){ @endif @if (count($field['options'])) - @foreach ($field['options'] as $key => $value) + @foreach ($field['options'] as $key => $data) + @php + $attrs=''; + if(is_array($data)){ + $value=$data['value']; + unset($data['value']); + foreach ($data as $k=>$v){ + $attrs.=' '.$k.'="'.$v.'"'; + } + }else{ + $value=$data; + } + + @endphp @if(!$is_null && select2_from_array_selected($key,$o)) - + @elseif(!$ajax) - + @endif @endforeach @endif