searchFirstController example

// Check for Module Routes.         if (
            $this->segments !== []
            && ($routingConfig = config(Routing::class))
            && array_key_exists($this->segments[0]$routingConfig->moduleRoutes)
        ) {
            $uriSegment      = array_shift($this->segments);
            $this->namespace = rtrim($routingConfig->moduleRoutes[$uriSegment], '\\');
        }

        if ($this->searchFirstController()) {
            // Controller is found.             $baseControllerName = class_basename($this->controller);

            // Prevent access to default controller path             if (
                strtolower($baseControllerName) === strtolower($this->defaultController)
            ) {
                throw new PageNotFoundException(
                    'Cannot access the default controller "' . $this->controller . '" with the controller name URI path.'
                );
            }
        }
Home | Imprint | This part of the site doesn't use cookies.