src/Traits/ContentEllipse.php
public function getShortContent($maxlength = 50, $attr = 'content')
    {
        $content = $this->{$attr};
        if (strlen($content) > $maxlength) {
            return substr($content, 0, $maxlength).'...';
        }

        return $content;
    }
public function getShortContent($maxlength = 50, $attr = 'content')
    {
        $content = $this->{$attr};
        if (strlen($content) > $maxlength) {
            return substr($content, 0, $maxlength).'...';
        }

        return $content;
    }
public function getShortContent ( $ maxlength = 50 , $ attr = 'content' ) { $ content = $ this -> { $ attr } ; if ( strlen ( $ content ) > $ maxlength ) { return substr ( $ content , 0 , $ maxlength ) . '...' ; } return $ content ; }
Cuts the content of a comment or a ticket content if it's too long.

@param int $maxlength

@return string
Cuts the content of a comment or a ticket content if it s too long .