File: D:/HostingSpaces/SBogers10/rentman.komma.pro/app/Komma/Sitemap/SitemapController.php
<?php
namespace Komma\Sitemap;
use Komma\Pages\PageService;
class SitemapController extends \BaseController
{
/**
* @var SitemapService
*/
private $sitemapService;
private $pageService;
private $data = [];
/**
* Sitemap Controller constructor.
* @param SitemapService $sitemapService
*/
public function __construct(SitemapService $sitemapService, PageService $pageService)
{
parent::__construct();
$this->sitemapService = $sitemapService;
$this->pageService = $pageService;
}
/**
* Sitemap.xml
* @return mixed
*/
public function sitemap()
{
$sitemap = $this->sitemapService->getSitemap(true);
return $sitemap->render();
}
/**
* Sitemap
* @return mixed
*/
public function showSitemap(){
$this->data = (object)[];
$this->data->content = $this->pageService->getPageByCodeName('sitemap');
$this->data->links = $this->pageService->getAllRoutes();
$page = $this->sitemapService->getSitemap();
$otherLanguages = $this->pageService->getOtherLanguageRoutes($this->data->content->id);
$this->data->id = 1;
return \View::make('layouts.pages.sitemap')
->with('otherLanguages', $otherLanguages->allTranslations)
->with(['data'=> $this->data, 'pages'=> $page]);
}
/**
* Robots.txt
* @return mixed
*/
public function robots()
{
$view = \View::make('seo.robots')->render();
return \Response::make($view, '200')->header('Content-Type', 'text/plain');
}
/**
* googlebcd14432801a1cca.html
* @return mixed
*/
public function gt()
{
$view = \View::make('seo.robots')->render();
return \Response::make($view, '200')->header('Content-Type', 'text/plain');
}
}