@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 = ['']; if(old($field['name'])){ $display_value = old($field['name']); }else{ if(isset($field['value']) && ( $field['value'] instanceof \Illuminate\Support\Collection && $field['value']->isNotEmpty() )){ $display_value = $field['value']->pluck($options->first()->getKeyName()); } } if (!is_array($display_value) && $display_value->isEmpty()) { $display_value = [ 0 => $field['default'] ?? -1 ]; } @endphp
@include('crud::inc.field_translatable_icon') @foreach ($display_value as $value_key => $value) @if($value_key !== 0)
@endif @if($value_key !== 0) @endif @if($value_key !== 0)
@endif @endforeach
{{-- HINT --}} @if (isset($field['hint']))

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

@endif @if (!isset($field['plus_btn']) || $field['plus_btn'])
@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 --}} {{-- ########################################## --}}