{{-- @php dd($attachments); @endphp --}} @foreach ($attachments as $attachment) @php $decoded = json_decode($attachment->value, true); $items = is_array($decoded) ? $decoded : [$attachment->value]; @endphp
  • {{ $attachment->formDetail->name }} @if (count($items) === 1 && !is_array($items[0])) [View Here] @else
      @foreach ($items as $item) {{-- Hardcode check for medium, small, thumbnail prefixes due to image resizer issue from old migration --}} @php $item_name = is_array($item) ? ($item['name'] ?? basename($item['file'])) : basename($item); $item_link = is_array($item) ? assetFile($item['file']) : assetFile($item); $valid_item = true; if(is_string($item_name)) { if(Str::contains($item_name, ['medium-', 'small-', 'thumbnail-'])){ $valid_item = false; } else { $item_name = str_replace('original--', '', $item_name); } } @endphp @if($valid_item)
    • {{ $item_name }} [View Here]
    • @endif @endforeach
    @endif
  • @endforeach