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/SBogers87/basephotography.nl/app/Komma/Projects/ProjectController.php
<?php

namespace Komma\Projects;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use Komma\BaseController;
use Komma\Pages\PageService;

class ProjectController extends \BaseController
{

    public $data;
    protected $projectService;
    protected $pageService;

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

        $this->data = (object)[
            'translations' => $this->pageService->getTextBlocks()
        ];
    }

    public function show($id = 2){
        $this->data->id = 3;

        $projects = $this->projectService->getProjects($id);

        $this->data->next = $projects['next'];
        $this->data->previous = $projects['previous'];
        $this->data->content = $projects['project'];
        $this->data->content->images = $this->projectService->splitImages($this->data->content->images);

        return \View::make('layouts.pages.project')->with([
            'data' => $this->data,
            'categories' => $this->projectService->getCategories(),
        ]);
    }

    public function sub(){
        $category = \Request::segment(2);
        $this->data->id = 3;
        $this->data->content = $this->pageService->getPageContent(3);

        $projects = $this->projectService->getCategoryImages($category);

        return \View::make('layouts.pages.projectCategory')->with([
            'data' => $this->data,
            'projects' => $projects,
            'categories' => $this->projectService->getCategories(),
            'active' => $category
        ]);
    }
}