File: D:/HostingSpaces/SBogers10/douven.komma.pro/app/KommaApp/Core/FrontendController.php
<?php
namespace App\KommaApp\Core;
use App\KommaApp\Kms\Core\Kms;
use App\KommaApp\Kms\Core\Sections\SectionService;
abstract class FrontendController extends WildcardController
{
/** @var string $forModelName For which model this controller works for */
protected $forModelName;
/** @var SectionService $service */
protected $service;
/** @var Kms $kms*/
protected $kms;
public function __construct()
{
$this->validateInitialisation();
$this->kms = \App::make(Kms::class);
}
private function validateInitialisation()
{
if(!$this->forModelName) throw new \RuntimeException('Make sure you set (override) the $forModelName property in the controller ('.get_class($this).') to the eloquent model the controller does it\'s job for.');
if(!$this->service) throw new \RuntimeException('Make sure you set (override) the $service property in the controller ('.get_class($this).') to SectionService implementation the controller does it\'s job for.');
}
}