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/reiskick.komma.nl/app/Countries/CountryController.php
<?php

namespace App\Countries;

use App\Base\Controller;
use Komma\KMS\Components\ComponentService;

final class CountryController extends Controller
{

    public function index()
    {
        $page = $this->links->countries->node;

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

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

    /**
     * @param  Country  $country
     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function show(Country $country)
    {
        if(!$country->active) return abort(404);
        $country->cleanUp();

        $page = $this->links->countries->node;

        /** @var CountryService $countryService */
        $countryService = app()->make(CountryService::class);

        // Return view
        return view('templates.countries_show',[
            'country' => $country,
            'links' => $this->links,
            'page' => $page,
            'sliderItems' => $countryService->getRelatedModels($country),
        ]);
    }
}