@foreach ($c['maps'] ?? [] as $map) @php $href = \App\Support\Content::href($map['url'] ?? null); // A live Google map is built from the place in the "Map link"; the image is the fallback. $embed = null; $parts = $href ? parse_url($href) : null; if ($parts && preg_match('/(^|\.)google\.[a-z.]+$/i', $parts['host'] ?? '')) { parse_str($parts['query'] ?? '', $q); $place = $q['query'] ?? $q['q'] ?? null; if (! $place && preg_match('#/maps/place/([^/]+)#', $parts['path'] ?? '', $m)) { $place = urldecode($m[1]); } if (is_string($place) && trim($place) !== '') { $embed = 'https://www.google.com/maps?q='.rawurlencode($place).'&output=embed&hl=en'; } } @endphp
  • @if ($embed) {{-- Google draws a place card in the top-left of the embed. The frame is moved up so that card sits outside the visible box. --}}
    @else @endif
    @if (filled($map['title'] ?? null))

    {{ $map['title'] }}

    @endif @if (filled($map['text'] ?? null))

    {{ $map['text'] }}

    @endif
    @if ($href && filled($map['button_label'] ?? null)) {{ $map['button_label'] }} {!! \App\Support\Icons::svg('btn-arrow', 'btn-icon size-[clamp(28px,2.4vw,34px)] max-sm:size-[34px]') !!} (opens Google Maps in a new tab) @endif
  • @endforeach