public function captureEnd(array $params = [])
    {
        if (! $this->captureStarted) {
            throw new RuntimeException('Capture has not been started.');
        }
        $params['capture'] = ob_get_clean();
        $this->attach($params);
        $this->captureStarted = false;

        return $this;
    }