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/netwerkbrabant.komma.pro/app/KommaApp/Questions/QuestionController.php
<?php

namespace App\KommaApp\Questions;

use App\Http\Controllers\Controller;
use App\KommaApp\Questions\Kms\QuestionService;
use App\KommaApp\Questions\Models\Question;
use Illuminate\Http\JsonResponse;

class QuestionController extends Controller
{
    private $modelPrefix = 'pages.questions';
    private $questionService;

    public function __construct(QuestionService $questionService)
    {
        parent::__construct();
        $this->questionService = $questionService;
    }

    /**
     * @param Question $question
     * @return \Illuminate\Contracts\View\View
     */
    public function index()
    {
        $questions = Question::with('translations')
            ->where('active', '=', 1)
            ->orderBy('lft')
            ->get();


        $page = $this->pageService->getPageById(request()->attributes->get('page_id'));

        $page->translation = $this->decodeDynamicContent($page->translation);


        // Return view
        return \View::make($this->baseViewPath.$this->modelPrefix.'.index',[
            'questions' => $questions,
            'page' => $page
        ]);
    }

}