{{-- Reusable CMS image field: pick a file, or tick "remove" to clear it.
There used to be a visible "…or paste an image URL / path" text box beside
the picker. It was confusing (two inputs for one value) so it is now
hidden: it still carries the stored value so that saving a form without
re-uploading keeps the current image, and existing remote/CDN URLs (the
seeded Unsplash links) survive untouched.
Expects:
$name — column name, e.g. "image" (file input) → hidden input is "{name}_url"
$label — field label
$current — existing stored value (URL or path under public/), or null
$folder — public/uploads sub-folder, shown as a hint only
--}}
@php
$textName = $name . '_url';
$current = $current ?? null;
$value = old($textName, $current);
@endphp
{{-- File picker + preview come from the shared component. --}}
@error($name) {{ $message }} @enderror
{{-- Keeps the current value across a save that does not re-upload. --}}
@if($value)
@endif
{{ ___('admin.uploads_are_saved_to_3e8bd6') }} public/uploads/{{ $folder ?? 'cms' }}{{ ___('admin.uploading_a_new_file_replaces_the_current_one_e8497b') }}
@error($textName) {{ $message }} @enderror