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