src/Viserio/Component/Routing/Traits/MiddlewareAwareTrait.php
public function withoutMiddleware($middleware = null): MiddlewareAwareContract
    {
        if ($middleware === null) {
            $this->middleware = [];

            return $this;
        }

        $this->validateInput($middleware);

        if (\is_object($middleware) || \is_string($middleware)) {
            $name = \is_object($middleware) ? \get_class($middleware) : $middleware;

            $this->bypassedMiddleware[$name] = true;

            return $this;
        }

        foreach ($middleware as $name => $middleware) {
            $middleware = $this->getMiddlewareClassName($middleware);
            $name       = \is_numeric($name) ? $middleware : $name;

            $this->bypassedMiddleware[$name] = true;
        }

        return $this;
    }
public function withoutMiddleware($middleware = null): MiddlewareAwareContract
    {
        if ($middleware === null) {
            $this->middleware = [];

            return $this;
        }

        $this->validateInput($middleware);

        if (\is_object($middleware) || \is_string($middleware)) {
            $name = \is_object($middleware) ? \get_class($middleware) : $middleware;

            $this->bypassedMiddleware[$name] = true;

            return $this;
        }

        foreach ($middleware as $name => $middleware) {
            $middleware = $this->getMiddlewareClassName($middleware);
            $name       = \is_numeric($name) ? $middleware : $name;

            $this->bypassedMiddleware[$name] = true;
        }

        return $this;
    }
Remove the given middleware from the route/controller.
If no middleware is passed, all middleware will be removed.

@param null|array|string $middleware

@throws \Viserio\Component\Contract\Routing\Exception\UnexpectedValueException if wrong type is given

@return \Viserio\Component\Contract\Routing\MiddlewareAware