Skip to content

Commit fee9726

Browse files
committed
document password
1 parent 0b59c83 commit fee9726

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

helpers.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Laravel includes a variety of global "helper" PHP functions. Many of these funct
133133
[Str::padBoth](#method-str-padboth)
134134
[Str::padLeft](#method-str-padleft)
135135
[Str::padRight](#method-str-padright)
136+
[Str::password](#method-str-password)
136137
[Str::plural](#method-str-plural)
137138
[Str::pluralStudly](#method-str-plural-studly)
138139
[Str::random](#method-str-random)
@@ -1739,6 +1740,21 @@ The `Str::padRight` method wraps PHP's `str_pad` function, padding the right sid
17391740

17401741
// 'James '
17411742

1743+
<a name="method-str-password"></a>
1744+
#### `Str::password()` {.collection-method}
1745+
1746+
The `Str::password` method may be used to generate a secure, random password of a given length. The password will consist of a combination of letters, numbers, symbols, and spaces. By default, passwords are 32 characters long:
1747+
1748+
use Illuminate\Support\Str;
1749+
1750+
$password = Str::password();
1751+
1752+
// 'EbJo2vE-AS:U,$%_gkrV4n,q~1xy/-_4'
1753+
1754+
$password = Str::password(12);
1755+
1756+
// 'qwuar>#V|i]N'
1757+
17421758
<a name="method-str-plural"></a>
17431759
#### `Str::plural()` {.collection-method}
17441760

0 commit comments

Comments
 (0)