<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>{{ url('/') }}</loc>
        <priority>1.0</priority>
        <changefreq>daily</changefreq>
    </url>

    @foreach($categories as $category)
    <url>
        <loc>{{ route('category', $category->slug) }}</loc>
        <lastmod>{{ $category->updated_at->tz('UTC')->toAtomString() }}</lastmod>
        <priority>0.8</priority>
        <changefreq>weekly</changefreq>
    </url>
    @endforeach


    @foreach($products as $product)
    @if($product->slug && $product->slug !== '')
    <url>
        <loc>{{ route('product.show', $product->slug) }}</loc>
        <lastmod>{{ $product->updated_at->tz('UTC')->toAtomString() }}</lastmod>
        <priority>0.9</priority>
        <changefreq>daily</changefreq>
    </url>
    @endif
    @endforeach


    @foreach($vendors as $vendor)
    <url>
        <loc>{{ route('vendor.store', $vendor->slug ?? $vendor->id) }}</loc>
        <lastmod>{{ $vendor->updated_at->tz('UTC')->toAtomString() }}</lastmod>
        <priority>0.7</priority>
        <changefreq>weekly</changefreq>
    </url>
    @endforeach

    {{-- Blog posts could be added here --}}
</urlset>
x



