]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/SitemapXmlController.php
twitch bot dummy
[alttp.git] / app / Http / Controllers / SitemapXmlController.php
index 1bd7749589507c3b5aad322bb2b914848a3cc097..99e909212f2bbced0371e0b9c01f9f6ea9e00684 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,14 +23,21 @@ 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;
+
                $url = new SitemapUrl();
                $url->path = '/tech';
-               $url->lastmod = Technique::latest()->first()->created_at;
+               $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('index', true)->get() as $tech) {
+               foreach (Technique::where('type', '=', 'tech')->where('index', true)->get() as $tech) {
                        $url = new SitemapUrl();
                        $url->path = '/tech/'.rawurlencode($tech->name);
                        $url->lastmod = $tech->updated_at ? $tech->updated_at : ($tech->created_at ? $tech->created_at : now());