@php
  /** @var iterable<int, array{loc:string,lastmod:string,changefreq:string,priority:string}> $safeUrls */
  $safeUrls = isset($urls) && is_iterable($urls) ? $urls : [];
  $xmlDeclaration = '<' . '?xml ';
  $xmlDeclaration .= 'version="1.0" ';
  $xmlDeclaration .= 'encoding="UTF-8"?' . '>';
  echo $xmlDeclaration;
@endphp
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  @foreach($safeUrls as $url)
    <url>
      <loc>{{ $url['loc'] }}</loc>
      <lastmod>{{ $url['lastmod'] }}</lastmod>
      <changefreq>{{ $url['changefreq'] }}</changefreq>
      <priority>{{ $url['priority'] }}</priority>
    </url>
  @endforeach
</urlset>