session()->get('status'); // Record the visit to the index (no album or photo to record a hit against though) if (UserConfig::get('enable_visitor_hits')) { DB::transaction(function () use ($request) { VisitorHit::fromRequest($request); }); } return Theme::render('gallery.index', [ 'albums' => $albums, 'info' => $request->session()->get('info'), 'success' => $resetStatus ]); } public function sitemapXml() { $xml = new \DOMDocument('1.0', 'UTF-8'); $xml->preserveWhiteSpace = true; $xml->formatOutput = true; $root = $xml->createElementNS('http://www.sitemaps.org/schemas/sitemap/0.9', 'urlset'); $xml->appendChild($root); // Root URL $this->createSitemapNode($xml, $root, route('home')); return response($xml->saveXML(), 200, ['Content-Type' => 'text/xml']); } private function createSitemapNode(\DOMDocument $document, \DOMElement $parentElement, $url) { $urlElement = $document->createElement('url'); $urlLocElement = $document->createElement('loc', $url); $urlElement->appendChild($urlLocElement); $parentElement->appendChild($urlElement); return $urlElement; } }