@php if (!isset($field['options'])) { if(isset($field['sorting'])){ $options = $field['model']::orderBy($field['sorting'])->get(); } else{ $options = $field['model']::all(); } } else { $options = call_user_func($field['options'], $field['model']); } $display_value = old($field['name']) ?? []; $key_name = ($field['key_name'])?? $options->first()->getKeyName(); if (empty($display_value) && $field['value']->isNotEmpty()) { $display_value = []; foreach ($field['value'] as $value) { $display_value[] = [ 'index' => $value[$key_name], 'value' => $value['pivot'][$field['pivot_value']] ?? $value[$field['pivot_value']] ?? "" ]; } } else if (empty($display_value)) { $display_value = [ [ 'index' => $field['default'] ?? -1, 'value' => "" ] ]; } @endphp
@include('crud::inc.field_translatable_icon') @foreach ($display_value as $value_key => $value) @if($value_key !== 0)
@endif
'form-control select2-plusable-input'])> @if($value_key !== 0) @endif @if($value_key !== 0)
@endif @endforeach
{{-- HINT --}} @if (isset($field['hint']))

{!! $field['hint'] !!}

@endif
{{-- ########################################## --}} {{-- Extra CSS and JS for this particular field --}} {{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} @if ($crud->checkIfFieldIsFirstOfItsType($field)) {{-- FIELD CSS - will be loaded in the after_styles section --}} @push('crud_fields_styles') @endpush @push('crud_fields_scripts') @if (app()->getLocale() !== 'en') @endif @endpush @endif @push('crud_fields_styles') @endpush {{-- FIELD JS - will be loaded in the after_scripts section --}} @push('crud_fields_scripts') @endpush @push('crud_fields_scripts') @endpush {{-- End of Extra CSS and JS --}} {{-- ########################################## --}}