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,
]);
}
}