Skip to content

Commit 2cdc358

Browse files
authored
Merge pull request #5954 from mvdnbrk/mvdnbrk-patch-1
Add fluent str is not empty
2 parents 551e394 + 216a454 commit 2cdc358

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

helpers.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
147147
[is](#method-fluent-str-is)
148148
[isAscii](#method-fluent-str-is-ascii)
149149
[isEmpty](#method-fluent-str-is-empty)
150+
[isNotEmpty](#method-fluent-str-is-not-empty)
150151
[kebab](#method-fluent-str-kebab)
151152
[length](#method-fluent-str-length)
152153
[limit](#method-fluent-str-limit)
@@ -1743,6 +1744,22 @@ The `isEmpty` method determines if the given string is empty:
17431744

17441745
// false
17451746

1747+
<a name="method-fluent-str-is-not-empty"></a>
1748+
#### `isNotEmpty` {#collection-method}
1749+
1750+
The `isNotEmpty` method determines if the given string is not empty:
1751+
1752+
1753+
use Illuminate\Support\Str;
1754+
1755+
$result = Str::of(' ')->trim()->isNotEmpty();
1756+
1757+
// false
1758+
1759+
$result = Str::of('Laravel')->trim()->isNotEmpty();
1760+
1761+
// true
1762+
17461763
<a name="method-fluent-str-kebab"></a>
17471764
#### `kebab` {#collection-method}
17481765

0 commit comments

Comments
 (0)