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/SBogers10/douven.komma.pro/app/KommaApp/Pages/PageController.php
<?php

namespace App\KommaApp\Pages;

use App\Http\Controllers\Controller;
use App\KommaApp\Pages\Models\Page;

class PageController extends Controller
{
    private $pagePrefix = 'pages.';
    protected $catService;

    public function __construct()
    {
        parent::__construct();
    }

    public function callDecodeDynamicContent($translation) {
        return $this->decodeDynamicContent($translation);
    }

    /**
     * @param Page $page
     * @return \Illuminate\Contracts\View\View
     */
    public function show(Page $page)
    {
        // Load translation by eager loading
        $page->load('translation', 'images');

        $page->translation = $this->decodeDynamicContent( $page->translation );

        $view = $this->baseViewPath.$this->pagePrefix. $page->code_name;
        if( ! \View::exists($view)) $view = $this->baseViewPath.$this->pagePrefix. 'default';

        $transportServicePage = null;
        if($page->code_name == 'home') {
            $transportServicePage = $this->pageService->getPageByCodeName('transportservice');
            $transportServicePage->load('images');
            $transportServicePage->translation = $this->decodeDynamicContent($transportServicePage->translation);
        }

        $subPages = null;
        if($page->code_name == 'references') {
            $subPages = $page->findChildren();
            foreach ($subPages as $subPage) {
                $subPage->load('translation', 'images');
            }
        }

//        \App::abort('500');

        // Return view
        return \View::make($view,[
            'page' => $page,
            'links' => $this->links,
            'categoryTree' => $this->categoryTree,
            'transportServicePage' => $transportServicePage,
            'subPages' => $subPages,
        ]);
    }

}