HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers79/artofeinstein.be/app/Komma/Seo/SEOController.php
<?php

namespace Komma\Seo;



use Illuminate\Routing\Controller;

class SEOController extends Controller
{
    /**
     * @var SitemapService
     */
    private $sitemapService;
    private $data = [];

    /**
     * SEOController constructor.
     * @param SitemapService $sitemapService
     */
    public function __construct(SitemapService $sitemapService)
    {
        $this->sitemapService = $sitemapService;
    }

    /**
     * Sitemap.xml
     * @return mixed
     */
    public function sitemap()
    {
        $sitemap = $this->sitemapService->getSitemap([
            'pages',
        ]);

        return $sitemap->render('xml');
    }

    /**
     * Sitemap
     * @return mixed
     */
    public function showSitemap(){
        $page = $this->sitemapService->getSitemap([
            'pages',
        ]);
        $this->data['id'] = 1;
        return \View::make('layouts.pages.sitemap')->with(['data'=> (object)$this->data, 'pages'=> $page->model->items]);
    }

    /**
     * Robots.txt
     * @return mixed
     */
    public function robots()
    {
        $view = \View::make('seo.robots')->render();
        return \Response::make($view, '200')->header('Content-Type', 'text/plain');
    }
}