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/SBogers106/rvt-trainingen.nl/app/Komma/Services/ServiceController.php
<?php

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

namespace Komma\Services;

use Komma\Pages\PageService;

class ServiceController extends \BaseController
{

    protected $pageService;
    protected $blockService;
    protected $projectService;

    public function __construct(PageService $pageService, ServiceService $serviceService)
    {
        parent::__construct();
        $this->pageService = $pageService;
        $this->serviceService = $serviceService;
    }

    //Project index page
    public function index(){
        //get content of page and get all page links
        $page = $this->pageService->getPageByCodeName('services');
        $links = $this->pageService->getAllRoutes();

        $page->translation->description = json_decode($page->translation->description);

        //Get all projects
        $services = $this->serviceService->getAllServices();

        return \View::make('layouts.pages.servicesOverview')
            ->with('page', $page)
            ->with('links', $links)
            ->with('services', $services);

    }

    public function show($serviceId){

        $page = $this->serviceService->getService($serviceId);
        $links = $this->pageService->getAllRoutes();

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

}