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/Vacancies/VacancyController.php
<?php

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

namespace Komma\Vacancies;

use Illuminate\Support\Facades\App;
use Komma\Blocks\BlockService;
use Komma\Pages\PageService;

class VacancyController extends \BaseController
{

    protected $pageService;
    protected $blockService;
    protected $vacancyService;

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

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

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

        $vacancies = $this->vacancyService->getAllVacancies();

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

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

    public function show($vacancyId){
        $page = $this->pageService->getPageByCodeName('vacancies');
        //Load vacancy content and translation of this vacancy
        $vacancy = $this->vacancyService->getVacancy($vacancyId);
        $links = $this->pageService->getAllRoutes();

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

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

}