Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added completeWords flag to limit str method #52245

Merged
merged 3 commits into from
Jul 23, 2024

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
29 checks passed
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.

None yet

2 participants