@props(['data' => [], 'eager' => false]) @php $imgPath = $data['path'] ?? $data['url'] ?? ''; if (is_array($imgPath)) { $imgPath = $imgPath[0] ?? ''; } $imgSrc = $imgPath && !str_starts_with($imgPath, 'http') ? Storage::disk('public')->url($imgPath) : $imgPath; // Intrinsic size reserves the space before load (no layout shift) $size = storage_image_size('public', $imgPath); @endphp @if($imgSrc)
{{ $data['alt'] ?? '' }} @if(!empty($data['caption']))
{{ $data['caption'] }}
@endif
@endif