protected function thenCallMiddleware($middleware)
    {
        if (function_exists('call_middleware')) {
            $this->result = call_middleware($middleware, $this->result);
        } else {
            $this->result = (new Caller($middleware))->call($this->result);
        }
        return $this->resultUnlessChainable();
    }