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/Eurotools/euro-tools.nl/app/KommaApp/CustomerService/CustomerServiceController.php
<?php

namespace App\KommaApp\CustomerService;

use App\Http\Controllers\Controller;
use App\KommaApp\CustomerService\Models\CustomerService;

class CustomerServiceController extends Controller
{
    private $CustomerServicePrefix = 'CustomerService.';

    /**
     * @param CustomerService $CustomerService
     * @return \Illuminate\Contracts\View\View
     */
    public function show(CustomerService $CustomerService)
    {
        // Load translation by eager loading
        $CustomerService->load( 'translation');

        // Check if given CustomerService belongs to the set site
        if($CustomerService->site_id != \App::getSite()->id) throw abort(404);

        // Get the route in other languages for menu and meta title
        $otherLanguageRoutes = $this->languageService->getOtherLanguagesRoutes($CustomerService);

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

        $view = $this->baseViewPath.$this->CustomerServicePrefix. $CustomerService->code_name;
        if( ! \View::exists($view)) $view = $this->baseViewPath.$this->CustomerServicePrefix. 'default';

        // Return view
        return \View::make($view,[
            'CustomerService' => $CustomerService,
            'links' => $this->links,
            'categories' => $this->categories,
            'otherLanguages' => $otherLanguageRoutes,
        ]);
    }

}