public static function getInstance() { if (empty(self::$instance)) { self::$instance = new self(); } if (empty(self::$instance)) { throw new \Exception('Base controller was unable to initiate'); } return self::$instance; }