Before, when you wanted to chain multiple string operations, you had to write nested function calls or multiple separate lines of code. This made the code harder to read.
Now with Str::of(), you can chain string methods in a clean, fluent way — similar to how Collections work.
Example:
use Illuminate\Support\Str;
$result = Str::of(' laravel is awesome ')
->trim()
->title()
->replace('Awesome', 'great');
// Result: "Laravel Is Great"Each method returns a new Stringable instance, so you can keep chaining as many operations as you need.
When to use it: Use Str::of() whenever you need to apply several string transformations in one place — instead of writing separate lines for each step.