public function description(string $description, int $maxLength = 250) : self
    {
        $description = trim(strip_tags($description));
        $description = preg_replace("/\r|\n/", '', $description);

        $length = mb_strlen($description);

        $description = mb_substr($description, 0, $maxLength);

        if (mb_strlen($description) < $length) {
            $description .= '...';
        }

        $this->forget('description');

        $this->tags[] = $this->createTag('description', $description);

        return $this;
    }
public function description(string $description, int $maxLength = 250) : self
    {
        $description = trim(strip_tags($description));
        $description = preg_replace("/\r|\n/", '', $description);

        $length = mb_strlen($description);

        $description = mb_substr($description, 0, $maxLength);

        if (mb_strlen($description) < $length) {
            $description .= '...';
        }

        $this->forget('description');

        $this->tags[] = $this->createTag('description', $description);

        return $this;
    }
public function description ( string $ description , int $ maxLength = 250 ) : self { $ description = trim ( strip_tags ( $ description ) ) ; $ description = preg_replace ( "/\r|\n/" , '' , $ description ) ; $ length = mb_strlen ( $ description ) ; $ description = mb_substr ( $ description , 0 , $ maxLength ) ; if ( mb_strlen ( $ description ) < $ length ) { $ description .= '...' ; } $ this -> forget ( 'description' ) ; $ this -> tags [ ] = $ this -> createTag ( 'description' , $ description ) ; return $ this ; }
Adds a description tag

@param  string $description The description text
@param  int    $description If the text is longer than this it is shortened
@return OpenGraph
Adds a description tag