protected function buildView()
    {
        if (isset($this->html)) {
            return array_filter([
                'html' => new HtmlString($this->html),
                'text' => $this->textView ?? null,
            ]);
        }

        if (isset($this->markdown)) {
            return $this->buildMarkdownView();
        }

        if (isset($this->view, $this->textView)) {
            return [$this->view, $this->textView];
        } elseif (isset($this->textView)) {
            return ['text' => $this->textView];
        }

        return $this->view;
    }
protected function buildView()
    {
        if (isset($this->html)) {
            return array_filter([
                'html' => new HtmlString($this->html),
                'text' => $this->textView ?? null,
            ]);
        }

        if (isset($this->markdown)) {
            return $this->buildMarkdownView();
        }

        if (isset($this->view, $this->textView)) {
            return [$this->view, $this->textView];
        } elseif (isset($this->textView)) {
            return ['text' => $this->textView];
        }

        return $this->view;
    }
protected function buildView ( ) { if ( isset ( $ this -> html ) ) { return array_filter ( [ 'html' => new HtmlString ( $ this -> html ) , 'text' => $ this -> textView ?? null , ] ) ; } if ( isset ( $ this -> markdown ) ) { return $ this -> buildMarkdownView ( ) ; } if ( isset ( $ this -> view , $ this -> textView ) ) { return [ $ this -> view , $ this -> textView ] ; } elseif ( isset ( $ this -> textView ) ) { return [ 'text' => $ this -> textView ] ; } return $ this -> view ; }
Build the view for the message.

@return array|string

@throws \ReflectionException
Build the view for the message .