]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/SitemapXmlController.php
store map position in history
[alttp.git] / app / Http / Controllers / SitemapXmlController.php
index 99e909212f2bbced0371e0b9c01f9f6ea9e00684..4393a30c0f88cdc0ecd6ff80587cf9fb529d74dd 100644 (file)
@@ -23,12 +23,17 @@ class SitemapXmlController extends Controller
                        $urls[] = $url;
                }
 
-               $url = new SitemapUrl();
-               $url->path = '/map';
-               $url->lastmod = TechniqueMap::latest()->first()->created_at;
-               $url->changefreq = 'monthly';
-               $url->priority = 0.9;
-               $urls[] = $url;
+               foreach (['lw', 'dw', 'sp', 'uw'] as $map) {
+                       $tech = TechniqueMap::where('map', '=', $map)->latest()->first();
+                       $url = new SitemapUrl();
+                       $url->path = '/map/'.$map;
+                       if ($tech) {
+                               $url->lastmod = $tech->created_at;
+                       }
+                       $url->changefreq = 'monthly';
+                       $url->priority = 0.9;
+                       $urls[] = $url;
+               }
 
                $url = new SitemapUrl();
                $url->path = '/tech';