Example #1
0
 /**
  * Sitemap (get).
  *
  * @Get("sitemap", as="sitemap.index")
  *
  * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
  */
 public function getIndex()
 {
     $this->siteMap->addUrls(config('sitemap.urls'), true)->addUrls($this->createSiteMapData(), false);
     return response($this->siteMap->saveXML(), 200, ['Content-Type' => 'text/xml; charset=utf-8']);
 }
Example #2
0
 /**
  * Test 'saveXML' method.
  */
 public function testSaveXML()
 {
     $this->assertTrue(is_string($this->sitemap->saveXML()));
 }