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/wingssprayer.komma.pro/app/Vacancies/VacancyController.php
<?php

namespace App\Vacancies;

use App\Base\Controller;
use App\Components\ComponentService;
use App\Forms\FormService;
use App\Vacancies\Models\Vacancy;

class VacancyController extends Controller
{
    /**
     * @var FormService
     */
    private $formService;
    private $vacancyService;
    private $processService;

    public function __construct()
    {
        parent::__construct();
        $this->vacancyService = app()->make(VacancyService::class);

        $this->formService = app()->make(FormService::class);
        $this->formService->setOrigin('vacancy');
    }

    /**
     * @param bool $hasBeenSend
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function index(bool $hasBeenSend = false)
    {
        $page = $this->links->vacancies->node;

        if (app()->getLocale() !== "nl") {
            abort(404);
        }

        // Make language menu for given page
        $languageMenu = $this->pageService->makeLanguageSwitchForPage($this->links->{$page->code_name}, $this->links->home);

        $componentService = app(ComponentService::class);
        $components = $componentService->getViewComponents($page->translation);

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

        $view = $hasBeenSend ? 'templates.vacancies_send' : 'templates.vacancies_index';

        // Return view
        return view($view,[
            'page' => $page,
            'links' => $this->links,
            'vacancies' => $vacancies,
            'components' => $components,
            'languageMenu' => $languageMenu,
        ]);
    }

    /**
     * @param Vacancy $vacancy
     * @return \Illuminate\Contracts\View\View
     */
    public function show(Vacancy $vacancy)
    {
        $vacancy->load('translation','translations', 'employee', 'employee.images');

        $componentService = app(ComponentService::class);
        $components = $componentService->getViewComponents($vacancy->translation);

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

        // Make language menu for given page
        $page = $this->links->posts->node;
        $languageMenu = $this->pageService->makeLanguageSwitchForPage($this->links->vacancies, $this->links->home);

        // Return view
        return view('templates.vacancies_show',[
            'page' => $page,
            'components' => $components,
            'vacancies' => $vacancies,
            'vacancy' => $vacancy,
            'links' => $this->links,
            'languageMenu' => $languageMenu,
        ]);
    }

    /**
     * @return \Illuminate\Contracts\View\View
     */
    public function filters()
    {
        $filters = request('filters');
        dd('customize filter function in VacancyController');
    }

}