@if (! $asDropdown && $choices)
@php
if (isset($attributes['class'])) {
$attributes['class'] = str_replace('form-control', '', $attributes['class']);
}
if (is_string($value) && str_contains($value, ',')) {
$value = explode(',', $value);
}
@endphp
@foreach ($choices as $key => $item)
@php
$checked = is_array($value) ? in_array($key, $value) : ($key == $value);
@endphp
@endforeach
@else
@php
$countSelected = count($value);
$placeholder = Arr::get($attributes, 'placeholder') ?: trans('core/base::forms.select_placeholder');
if ($countSelected && $countSelected > 3) {
$placeholder = trans('core/base::forms.count_selected', ['count' => $countSelected]);
}
@endphp
{{ $placeholder }}
@if($ajaxUrl)
@foreach($value as $item)
@endforeach
@endif
@endif