Skip to content

Commit

Permalink
Added str macro for first and last words of a string
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoxavier committed Jun 20, 2024
1 parent d5cf4c7 commit 603267e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Macros/StrMacros.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function firstAndLastWords(): void
->values()
->whenNotEmpty(function (Collection $words): string {
return trim($words->first().' '.$words->last());
}, $string);
}, fn () => $string);
});
}

Expand Down

0 comments on commit 603267e

Please sign in to comment.