@php $field['wrapper'] = $field['wrapper'] ?? $field['wrapperAttributes'] ?? []; $field['wrapper']['class'] = $field['wrapper']['class'] ?? "form-group col-sm-12"; $field['wrapper']['class'] = $field['wrapper']['class'].' cropperImage'; $field['wrapper']['data-aspectRatio'] = $field['aspect_ratio'] ?? 0; $field['wrapper']['data-crop'] = $field['crop'] ?? false; $field['wrapper']['data-field-name'] = $field['wrapper']['data-field-name'] ?? $field['name']; $field['wrapper']['data-init-function'] = $field['wrapper']['data-init-function'] ?? 'bpFieldInitBase64CropperImageElement'; // calculate the value of the hidden input if (!is_null(old(square_brackets_to_dots($field['name'])))) { $value = old(square_brackets_to_dots($field['name'])); } elseif(isset($field['src']) && isset($entry)) { $value = $entry->find($entry->id)->{$field['src']}(); } else { $value = $field['value'] ?? $field['default'] ?? ''; } @endphp @include('crud::fields.inc.wrapper_start')
{!! $field['hint'] !!}
@endif @include('crud::fields.inc.wrapper_end') {{-- ########################################## --}} {{-- 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->fieldTypeNotLoaded($field)) @php $crud->markFieldTypeAsLoaded($field); @endphp {{-- FIELD CSS - will be loaded in the after_styles section --}} @push('crud_fields_styles') @endpush {{-- FIELD JS - will be loaded in the after_scripts section --}} @push('crud_fields_scripts') @endpush @endif {{-- End of Extra CSS and JS --}} {{-- ########################################## --}}