Skip to content

Conversation

@itsmewes
Copy link
Contributor

@itsmewes itsmewes commented Jul 23, 2024

This was originally from PR #52110 but there was an issue with the branching.

Currently for limiting string lengths you can use Str::limit and Str::words which are great options. The problem that I ran into is that I would like to limit the string to whole words. Str::limit can cut into a word and Str::words can be tough to use since the length of a string is wildly different depending on word sizes. This PR adds a new completeWords flag to the limit method that will respect word boundaries.

@taylorotwell taylorotwell merged commit b18f333 into laravel:11.x Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants