Home API Tools Posts Hire Me About
Sign In Create Account
Laravel

Laravel Str Helper: String Manipulation

January 16, 2026 1 min read 28 views

Powerful string helpers:

Common Methods

Str::slug('Laravel Framework'); // laravel-framework
Str::title('hello world'); // Hello World
Str::camel('foo_bar'); // fooBar
Str::kebab('fooBar'); // foo-bar

Fluent Strings

$result = Str::of('  Laravel  ')
    ->trim()
    ->lower()
    ->slug();

Useful Methods

Str::limit('Long text...', 10);
Str::words('Many words here', 2);
Str::mask('secret', '*', 2); // se****
Str::uuid();

Conditionals

Str::contains('Laravel', 'ara'); // true
Str::startsWith('Laravel', 'Lar'); // true
Share this post:

Related Posts

Comments (0)

Please log in to leave a comment. Log in

No comments yet. Be the first to comment!