@props([ 'name' => null, 'label' => 'Photo', 'facingMode' => 'environment', 'currentUrl' => null, 'wrapperClass' => '', /** Flat list of validation messages for this field (do not name this prop "errors" — it clashes with the shared error bag). */ 'errorMessages' => [], 'id' => null, /** Alpine expression for dynamic input name, e.g. "'guarantors[' + index + '][photo]'" */ 'nameAlpine' => null, /** Alpine expression for existing preview URL, e.g. "guarantor.photo_url" */ 'currentUrlAlpine' => null, 'accept' => 'image/*', /** When false, hide the per-slot empty-state hint (use a shared section hint instead). */ 'showEmptyHint' => true, 'required' => null, ]) @php $inputId = $id ?? ($name ?: null); $isDynamic = filled($nameAlpine); $urlExpr = $isDynamic && filled($currentUrlAlpine) ? $currentUrlAlpine : 'null'; @endphp
{{-- Keep file input out of flex layout: focused sr-only file inputs collapse modal width in Chrome. --}}

Ready to save:

@if ($showEmptyHint)

Use the camera for a live capture, or upload an existing image.

@endif

Live camera preview needs HTTPS. On this connection, Take photo opens your device camera or file picker instead.

{{-- Camera overlay — full viewport on mobile (teleport avoids modal clipping) --}}