@props(['name', 'label', 'preview' => null, 'accept' => 'image/*', 'hint' => null, 'removeName' => null]) {{-- Image upload with the current file as preview; removeName adds a "remove" box (the file is deleted on save). --}} @php($id = $attributes->get('id', $name)) @php($key = str_replace(['[', ']'], ['.', ''], $name))
@if ($preview) @endif except('id')->class('block w-full text-sm text-gray-500 file:me-3 file:rounded-lg file:border-0 file:bg-gray-100 file:px-3 file:py-2 file:text-sm file:font-medium hover:file:bg-gray-200 dark:file:bg-gray-800 dark:file:text-gray-200') }}> @if ($hint)

{{ $hint }}

@endif @if ($removeName) @endif @error($key)

{{ $message }}

@enderror