File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ Laravel includes a variety of functions for manipulating string values. Many of
152
152
[ excerpt] ( #method-fluent-str-excerpt )
153
153
[ explode] ( #method-fluent-str-explode )
154
154
[ finish] ( #method-fluent-str-finish )
155
+ [ hash] ( #method-fluent-str-hash )
155
156
[ headline] ( #method-fluent-str-headline )
156
157
[ inlineMarkdown] ( #method-fluent-str-inline-markdown )
157
158
[ is] ( #method-fluent-str-is )
@@ -2278,6 +2279,19 @@ $adjusted = Str::of('this/string/')->finish('/');
2278
2279
// this/string/
2279
2280
```
2280
2281
2282
+ <a name =" method-fluent-str-hash " ></a >
2283
+ #### ` hash ` {.collection-method}
2284
+
2285
+ The ` hash ` method hashes the string using the given [ algorithm] ( https://www.php.net/manual/en/function.hash-algos.php ) :
2286
+
2287
+ ``` php
2288
+ use Illuminate\Support\Str;
2289
+
2290
+ $hashed = Str::of('secret')->hash(algorithm: 'sha256');
2291
+
2292
+ // '2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b'
2293
+ ```
2294
+
2281
2295
<a name =" method-fluent-str-headline " ></a >
2282
2296
#### ` headline ` {.collection-method}
2283
2297
You can’t perform that action at this time.
0 commit comments