Returns "Tay..." echo Str::limit('Taylor Otwell', 3); Limit the number of characters and append a custom ending echo Str::limit('Taylor Otwell', 3, '---');
public function limit($value, $limit = 100, $end = '...') { if ($this->length($value) <= $limit) { return $value; } $value = MB_STRING ? mb_substr($value, 0, $limit, $this->encoding) : substr($string, 0, $limit); return $value . $end; }