Laravel Str Helper: String Manipulation
January 16, 2026
•
1 min read
•
28 views
Table of Contents
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
Related Posts
Laravel Sanctum API Authentication Complete Guide
Build secure API authentication with Laravel Sanctum for SPAs and mobile apps.
Laravel Rate Limiting: Protect Your Application
Implement rate limiting to protect your Laravel application from abuse.
Laravel Blade Components: Build Reusable UI
Create powerful reusable components with Laravel Blade.
Comments (0)
No comments yet. Be the first to comment!