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/debierbaron.komma.pro/app/Komma/Pages/PageController.php
<?php

namespace Komma\Pages;

use Illuminate\Http\Request;
use Komma\BaseController;
use Komma\Boxes\BoxService;

class PageController extends \BaseController
{
    private$boxService;
    public $data;
    protected $pageService;

    public function __construct(PageService $pageService, boxService $boxService){;
        $this->pageService = $pageService;
        $this->boxService = $boxService;

        $this->data = (object)[];
    }

    public function show($id = 2){
        $page = $this->pageService->getPageById($id);
        $this->data->id = $id;
        $this->data->content = $this->pageService->getPageContent($id);

        $this->data->content->meta_title = $page->name;


        switch ($page->code_name){
            case 'home' :
                $this->data->lastbox= $this->boxService->getLastBox();
                return \View::make('layouts.pages.home')->with('data', $this->data);
                break;
            case 'about' :
                return \View::make('layouts.pages.about')->with('data', $this->data);
                break;
            case 'contact' :
                return \View::make('layouts.pages.contact')->with('data', $this->data);
                break;
            case 'howitworks' :
                return \View::make('layouts.pages.howitworks')->with('data', $this->data);
                break;
            case 'vaderdag' :
                return \View::make('layouts.pages.vaderdag')->with('data', $this->data);
                break;
            case 'subscription-thanks' :
                return \View::make('layouts.pages.subscription-thanks')->with('data', $this->data);
                break;
            case 'shop-thanks' :
                return \View::make('layouts.pages.shop-thanks')->with('data', $this->data);
                break;
            case 'email' :
                return \View::make('emails.shop.customerPaid')->with('data', $this->data);
                break;
            case 'newsletter' :
                return \View::make('layouts.pages.newsletter')->with('data', $this->data);
                break;
            default:
                dd($page->code_name);
        }

        return \View::make('layouts.pages.'.$this->data->content->code_name)->with('data', $this->data);
    }

    public function index(){
        echo "hoi";
    }
}