protected function callMiddleware(
        $middleware,
        string $method = "",
        array &$arguments = [],
        string $type = Caller::TYPE_DEFAULT,
        $result = null
    ) {
        if (! $this->skipMiddleware) {
            $result = $this->middlewareCaller($middleware, $result)
                ->as($type)
                ->catch($this->catchHaltExceptions)
                ->call($method, $arguments);
        }
        return $result;
    }