cut pice of text in laravel

PHP
 mb_substr($val->topicSubject , 0 , 50 , "utf-8")
Source

Also in PHP: