@php use Illuminate\Support\Facades\Storage; $field ??= []; @endphp
@include('admin.panel.fields.inc.translatable_icon')
{{-- Wrap the image or canvas element with a block element (container) --}}
@php $diskName = $field['disk'] ?? null; // Get default picture & its URL $defaultPicture = config('larapen.media.picture'); $defaultPictureUrl = Storage::disk($diskName)->url($defaultPicture); // Get default value (Need to be sent|filled as URL) $defaultValue = $field['default'] ?? null; $defaultValue = (!empty($defaultValue) && is_string($defaultValue)) ? $defaultValue : $defaultPictureUrl; // Get value (Sent|filled as storage path) $value = $field['value'] ?? null; // Get the picture's URL $pictureUrl = (!empty($value) && is_string($value)) ? Storage::disk($diskName)->url($value) : $defaultValue; // $pictureUrl = is_string($value) ? thumbParam($value)->setOption('picture-md')->url() : $defaultValue; $pictureUrl = old($field['name'], $pictureUrl); // Get the picture's URL with prefix path (If filled) $prefix = $field['prefix'] ?? ''; $pictureUrl = $prefix . $pictureUrl; @endphp
@if (isset($field['crop']) && $field['crop'])
@endif
@if (isset($field['crop']) && $field['crop']) @endif
{{-- 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 ($xPanel->checkIfFieldIsFirstOfItsType($field, $fields)) {{-- FIELD CSS - will be loaded in the after_styles section --}} @push('crud_fields_styles') {{-- YOUR CSS HERE --}} @endpush {{-- FIELD JS - will be loaded in the after_scripts section --}} @push('crud_fields_scripts') {{-- YOUR JS HERE --}} @endpush @endif {{-- End of Extra CSS and JS --}} {{-- ########################################## --}}