protected function initializeForModelRoute()
    {
        $this->moduleKey        = $this->routeHelper->getModuleKeyForCurrentRoute();
        $this->modelSlug        = $this->routeHelper->getModelSlugForCurrentRoute();
        $this->permissionPrefix = $this->routeHelper->getPermissionPrefixForModelSlug($this->modelSlug);

        if ( ! $this->moduleKey) {
            // @codeCoverageIgnoreStart
            throw new RuntimeException("Could not determine module key for route");
            // @codeCoverageIgnoreEnd
        }

        $this->modelInformation = $this->infoRepository->getByKey($this->modelSlug);

        if ( ! $this->modelInformation) {
            // @codeCoverageIgnoreStart
            throw new RuntimeException("Could not load information for model key '{$this->modelSlug}'");
            // @codeCoverageIgnoreEnd
        }

        $this->routePrefix = $this->routeHelper->getRouteNameForModelClass(
            $this->modelInformation->modelClass(),
            true
        );

        return $this;
    }
protected function initializeForModelRoute()
    {
        $this->moduleKey        = $this->routeHelper->getModuleKeyForCurrentRoute();
        $this->modelSlug        = $this->routeHelper->getModelSlugForCurrentRoute();
        $this->permissionPrefix = $this->routeHelper->getPermissionPrefixForModelSlug($this->modelSlug);

        if ( ! $this->moduleKey) {
            // @codeCoverageIgnoreStart
            throw new RuntimeException("Could not determine module key for route");
            // @codeCoverageIgnoreEnd
        }

        $this->modelInformation = $this->infoRepository->getByKey($this->modelSlug);

        if ( ! $this->modelInformation) {
            // @codeCoverageIgnoreStart
            throw new RuntimeException("Could not load information for model key '{$this->modelSlug}'");
            // @codeCoverageIgnoreEnd
        }

        $this->routePrefix = $this->routeHelper->getRouteNameForModelClass(
            $this->modelInformation->modelClass(),
            true
        );

        return $this;
    }
protected function initializeForModelRoute ( ) { $ this -> moduleKey = $ this -> routeHelper -> getModuleKeyForCurrentRoute ( ) ; $ this -> modelSlug = $ this -> routeHelper -> getModelSlugForCurrentRoute ( ) ; $ this -> permissionPrefix = $ this -> routeHelper -> getPermissionPrefixForModelSlug ( $ this -> modelSlug ) ; if ( ! $ this -> moduleKey ) { // @codeCoverageIgnoreStart throw new RuntimeException ( "Could not determine module key for route" ) ; // @codeCoverageIgnoreEnd } $ this -> modelInformation = $ this -> infoRepository -> getByKey ( $ this -> modelSlug ) ; if ( ! $ this -> modelInformation ) { // @codeCoverageIgnoreStart throw new RuntimeException ( "Could not load information for model key '{$this->modelSlug}'" ) ; // @codeCoverageIgnoreEnd } $ this -> routePrefix = $ this -> routeHelper -> getRouteNameForModelClass ( $ this -> modelInformation -> modelClass ( ) , true ) ; return $ this ; }
Initializes controller and checks context expecting a model route.

@return $this
Initializes controller and checks context expecting a model route .