Laravel Fluent Str - 48 Methods [πŸš€ 10 MINUTES!]

cleancodestudio image

Did you know I have a newsletter? πŸ“¬

If you want to get notified when I publish new blog posts or make major project announcements, head over to https://cleancodestudio.paperform.co/

πŸš€ 10 MINUTES. EVERY LARAVEL FLUENT STRING METHOD (THATS 48 METHODS!)

It's nice when your developer experience, and over all work flow convenience, is improved with features purely meant to make your life better. With Laravel 7's New Fluent String Feature, you can access almost every single Str facade method - fluently!

Str::of('hello world')->upper();

// HELLO WORLD
Str::of('HELLO WORLD')->camel();

// HelloWorld
Str::of('HelloWorld')->lower();

// helloworld
Str::of('hello world')->kebab();

// hello-world
Str::of('hello-world')->title();

// Hello World
Str::of('Hello World')->snake();

// hello_world
Str::of('hello_world')->studly();

// HelloWorld
Str::of('hello world')->ucfirst();

// Hello world
Str::of('hello world')->plural();

// hello worlds
Str::of('hello worlds')->singular();

// hello world
Str::of('hello world')->slug();

// hello-world
cleancodestudio image

Did you know I have a newsletter? πŸ“¬

If you want to get notified when I publish new blog posts or make major project announcements, head over to https://cleancodestudio.paperform.co/

4