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/kemi.komma.pro/app/KommaApp/Jobs/JobController.php
<?php

namespace App\KommaApp\Jobs;

use App\Http\Controllers\Controller;
use App\KommaApp\Jobs\Models\Job;

class JobController extends Controller
{
    private $pagePrefix = 'pages.jobs.';
    private $jobService;

    public function __construct(JobService $jobService)
    {
        parent::__construct();
        $this->jobService = $jobService;
    }

    /**
     * @return \Illuminate\Contracts\View\View
     */
    public function index()
    {
        $page = $this->pageService->getPageByCodeName('jobs');
        $page->translation = $this->decodeDynamicContent( $page->translation );
        $otherLanguageRoutes = $this->languageService->getOtherLanguagesRoutes($page);

        $jobs = $this->jobService->getAllJobs(false);

        // Return view
        return \View::make($this->baseViewPath.$this->pagePrefix.'index',[
            'page' => $page,
            'links' => $this->links,
            'otherLanguages' => $otherLanguageRoutes,
            'jobs' => $jobs,
            'jobCount' => $this->jobCount,
        ]);
    }

    /**
     * @return \Illuminate\Contracts\View\View
     */
    public function filters()
    {
        $filters = request('filters');
        var_dump('Filter jobs with these filters:');
        dd($filters);

        $page = $this->pageService->getPageByCodeName('jobs');
        $otherLanguageRoutes = $this->languageService->getOtherLanguagesRoutes($page);

        $jobs = $this->jobService->getAllJobs(false);


        // Return view
        return \View::make($this->baseViewPath.$this->pagePrefix.'index',[
            'page' => $page,
            'links' => $this->links,
            'otherLanguages' => $otherLanguageRoutes,
            'jobs' => $jobs,
        ]);
    }


    /**
     * @param Job $job
     * @return \Illuminate\Contracts\View\View
     * @internal param Page $page
     */
    public function show(Job $job)
    {
        $job->load('translation');

        $page = $this->pageService->getPageByCodeName('jobs');
        $page->translation = $this->decodeDynamicContent( $page->translation );
        $otherLanguageRoutes = $this->languageService->getOtherLanguagesRoutes($page, $job);

        // Return view
        return \View::make($this->baseViewPath.$this->pagePrefix.'show',[
            'page' => $page,
            'job' => $job,
            'links' => $this->links,
            'otherLanguages' => $otherLanguageRoutes,
            'jobCount' => $this->jobCount,
        ]);
    }

}