src/Middleware/Middleware.php
public function executeFor(Route $route): bool
    {
        if (null === $this->pathConstraint) {
            return true;
        }

        return strpos($route->getPath(), $this->pathConstraint) === 0;
    }
public function executeFor(Route $route): bool
    {
        if (null === $this->pathConstraint) {
            return true;
        }

        return strpos($route->getPath(), $this->pathConstraint) === 0;
    }
Checks if this item should be executed for a given Route

@param Route $route

@return bool