@push('scripts')
  <script type="text/javascript">
    let multipleLists;
    (function () {
      "use strict";
      multipleLists = new Choices(document.getElementById('custom_fields'), {
        searchEnabled: true,
        removeItemButton: true,
        placeholder: true, // Optional: Show placeholder text
      });
    })();
  </script>
@endpush
<select name="custom_fields[]" id="custom_fields" class="form-select form-select-lg" multiple required>
  <option value="">{{__('app.select_field')}}</option>
  @foreach($list_custom_fields as $custom_field)
    <option value="{{ $custom_field->custom_field_id  }}" @if($custom_field_ids) {{ (in_array($custom_field->custom_field_id, explode(',', $custom_field_ids))) ? 'selected' : '' }} @endif>{{ $custom_field->name  }}</option>
  @endforeach
</select>