Laravel Fluent Str - 48 Methods [🚀 10 MINUTES!]
Tags: laravel, php, tutorial, showdev
Published: 2021-07-28 04:38:14

{% user cleancodestudio %} 

[![Twitter Follow](https://img.shields.io/twitter/follow/cleancodestudio.svg?style=social)](https://twitter.com/cleancodestudio) 

---

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!)

---

{% youtube 8V91KpmdwYo %}

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!

### [Upper](https://www.youtube.com/watch?v=8V91KpmdwYo&t=10s)
```php
Str::of('hello world')->upper();

// HELLO WORLD
```


### [Camel](https://www.youtube.com/watch?v=8V91KpmdwYo&t=14s)
```php
Str::of('HELLO WORLD')->camel();

// HelloWorld
```

### [Lower](https://www.youtube.com/watch?v=8V91KpmdwYo&t=16s)
```php
Str::of('HelloWorld')->lower();

// helloworld
```

### [Kebab](https://www.youtube.com/watch?v=8V91KpmdwYo&t=25s)
```php
Str::of('hello world')->kebab();

// hello-world
```

### [Title](https://www.youtube.com/watch?v=8V91KpmdwYo&t=29s)

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

// Hello World
```


### [Snake](https://www.youtube.com/watch?v=8V91KpmdwYo&t=35s)

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

// hello_world
```

### [Studly](https://www.youtube.com/watch?v=8V91KpmdwYo&t=40s)

```php
Str::of('hello_world')->studly();

// HelloWorld
```

### [ucfirst](https://www.youtube.com/watch?v=8V91KpmdwYo&t=45s)
```php
Str::of('hello world')->ucfirst();

// Hello world
```

### [Plural](https://www.youtube.com/watch?v=8V91KpmdwYo&t=47s)
```php
Str::of('hello world')->plural();

// hello worlds
```

### [Singular](https://www.youtube.com/watch?v=8V91KpmdwYo&t=50s)
```php
Str::of('hello worlds')->singular();

// hello world
```

### [Slug](https://www.youtube.com/watch?v=8V91KpmdwYo&t=55s)
```php
Str::of('hello world')->slug();

// hello-world
```

### [Exactly](https://www.youtube.com/watch?v=8V91KpmdwYo&t=67s)

### [is](https://www.youtube.com/watch?v=8V91KpmdwYo&t=78s)

### [isNotEmpty](https://www.youtube.com/watch?v=8V91KpmdwYo&t=103s)

### [isEmpty](https://www.youtube.com/watch?v=8V91KpmdwYo&t=113s)

### [whenEmpty](https://www.youtube.com/watch?v=8V91KpmdwYo&t=123s)

### [startsWith](https://www.youtube.com/watch?v=8V91KpmdwYo&t=135s)

### [endsWith](https://www.youtube.com/watch?v=8V91KpmdwYo&t=144s)

### [contains](https://www.youtube.com/watch?v=8V91KpmdwYo&t=167s)

### [containsAll](https://www.youtube.com/watch?v=8V91KpmdwYo&t=177s)

### [substr](https://www.youtube.com/watch?v=8V91KpmdwYo&t=200s)

### [before](https://www.youtube.com/watch?v=8V91KpmdwYo&t=216s)

### [rtrim](https://www.youtube.com/watch?v=8V91KpmdwYo&t=220s)

### [after](https://www.youtube.com/watch?v=8V91KpmdwYo&t=225s)

### [ltrim](https://www.youtube.com/watch?v=8V91KpmdwYo&t=227s)

### [beforeLast](https://www.youtube.com/watch?v=8V91KpmdwYo&t=230s)

### [trim](https://www.youtube.com/watch?v=8V91KpmdwYo&t=240s)

### [afterLast](https://www.youtube.com/watch?v=8V91KpmdwYo&t=270s)

### [dirName](https://www.youtube.com/watch?v=8V91KpmdwYo&t=288s)

### [basename](https://www.youtube.com/watch?v=8V91KpmdwYo&t=289s)

### [replace](https://www.youtube.com/watch?v=8V91KpmdwYo&t=306s)

### [replaceArray](https://www.youtube.com/watch?v=8V91KpmdwYo&t=315s)

### [replaceLast](https://www.youtube.com/watch?v=8V91KpmdwYo&t=356s)

### [replaceFirst](https://www.youtube.com/watch?v=8V91KpmdwYo&t=360s)

### [replaceMatches](https://www.youtube.com/watch?v=8V91KpmdwYo&t=365s)

### [finish](https://www.youtube.com/watch?v=8V91KpmdwYo&t=407s)

### [start](https://www.youtube.com/watch?v=8V91KpmdwYo&t=438s)

### [append](https://www.youtube.com/watch?v=8V91KpmdwYo&t=453s)

### [prepend](https://www.youtube.com/watch?v=8V91KpmdwYo&t=456s)

### [isAscii](https://www.youtube.com/watch?v=8V91KpmdwYo&t=473s)

### [ascii](https://www.youtube.com/watch?v=8V91KpmdwYo&t=483s)

### [explode](https://www.youtube.com/watch?v=8V91KpmdwYo&t=493s)

### [length](https://www.youtube.com/watch?v=8V91KpmdwYo&t=503s)

### [limit](https://www.youtube.com/watch?v=8V91KpmdwYo&t=504s)

### [words](https://www.youtube.com/watch?v=8V91KpmdwYo&t=518s)

### [split](https://www.youtube.com/watch?v=8V91KpmdwYo&t=536s)

### [match](https://www.youtube.com/watch?v=8V91KpmdwYo&t=557s)

### [matchAll](https://www.youtube.com/watch?v=8V91KpmdwYo&t=571s)


[Clean Code](https://cleancode.studio/clean-code)
[Clean Code Studio](https://cleancode.studio)

---


{% user cleancodestudio %}


---

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/