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/SBogers110/franciscaansebeweging.nl/app/Komma/Mirrortents/MirrortentController.php
<?php

/**
 * Short description for the file.
 *
 * @author      Komma <support@komma.pro>
 * @copyright   (c) 2012-2015, Komma Mediadesign
 */

namespace Komma\Mirrortents;

use Carbon\Carbon;
use Komma\Blocks\BlockService;
use Komma\Categories\Models\Category;
use Komma\LanguageService;
use Komma\Pages\PageService;

class MirrortentController extends \BaseController
{

    public $data;
    protected $pageService;
    protected $blockService;
    protected $mirrortentService;

    public function __construct(PageService $pageService, BlockService $blockService, MirrortentService $mirrortentService)
    {
        parent::__construct();
        $this->pageService = $pageService;
        $this->blockService = $blockService;
        $this->mirrortentService = $mirrortentService;
    }

    //Overview page
    public function index($page = null){

        if($page == null){
            $page = $this->pageService->getPageByCodeName('mirrortents');
        }

        $mirrortents = $this->mirrortentService->getAllMirrortents();
        $mirrortents = $this->mirrortentService->convertForSorting($mirrortents);

        $links = $this->pageService->getAllRoutes();

        return \View::make('layouts.pages.mirrortents.index')
            ->with('page', $page)
            ->with('mirrortents', $mirrortents)
            ->with('links', $links);
    }

    public function show($mirrortentId){
        $page = $this->pageService->getPageByCodeName('mirrortents');

        //Load mirrortent content and translation of this mirrortent
        $mirrortent = $this->mirrortentService->getMirrortent($mirrortentId);
        $links = $this->pageService->getAllRoutes();

//        $mirrortent->date = Carbon::createFromFormat('Y-m-d H:i:s', $mirrortent->date);

        $mirrortent->dates = $mirrortent->getMirrortentDates();

        return \View::make('layouts.pages.mirrortents.show')
            ->with('page', $page)
            ->with('mirrortent', $mirrortent)
            ->with('links', $links);
    }

}