]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/SitemapXmlController.php
basic content editing
[alttp.git] / app / Http / Controllers / SitemapXmlController.php
index daa3699b714d72fd4f8ee4a9e6edcbdfe5896546..4f66486b4b89f1576be894b9bb82bb5ddda4d69a 100644 (file)
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
 
 use App\Models\SitemapUrl;
 use App\Models\Technique;
+use App\Models\TechniqueMap;
 use App\Models\Tournament;
 use Illuminate\Http\Request;
 
@@ -22,11 +23,23 @@ class SitemapXmlController extends Controller
                        $urls[] = $url;
                }
 
+               foreach (['lw', 'dw', 'sp', 'uw', 'uw2'] 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';
                $url->lastmod = Technique::where('type', '=', 'tech')->where('index', true)->latest()->first()->created_at;
                $url->changefreq = 'monthly';
-               $url->priority = 0.5;
+               $url->priority = 0.8;
                $urls[] = $url;
 
                foreach (Technique::where('type', '=', 'tech')->where('index', true)->get() as $tech) {