diff --git a/strings.md b/strings.md index 9d8c4654a8..4ce05c113f 100644 --- a/strings.md +++ b/strings.md @@ -145,8 +145,10 @@ Laravel includes a variety of functions for manipulating string values. Many of [chopEnd](#method-fluent-str-chop-end) [contains](#method-fluent-str-contains) [containsAll](#method-fluent-str-contains-all) +[decrypt](#method-fluent-str-decrypt) [deduplicate](#method-fluent-str-deduplicate) [dirname](#method-fluent-str-dirname) +[encrypt](#method-fluent-str-encrypt) [endsWith](#method-fluent-str-ends-with) [exactly](#method-fluent-str-exactly) [excerpt](#method-fluent-str-excerpt) @@ -2140,6 +2142,21 @@ $containsAll = Str::of('This is my name')->containsAll(['MY', 'NAME'], ignoreCas // true ``` + +#### `decrypt` {.collection-method} + +The `decrypt` method [decrypts](/docs/{{version}}/encryption) the encrypted string: + +```php +use Illuminate\Support\Str; + +$decrypted = $encrypted->decrypt(); + +// 'secret' +``` + +For the inverse of `decrypt`, see the [encrypt](#method-fluent-str-encrypt) method. + #### `deduplicate` {.collection-method} @@ -2186,6 +2203,19 @@ $string = Str::of('/foo/bar/baz')->dirname(2); // '/foo' ``` + +#### `encrypt` {.collection-method} + +The `encrypt` method [encrypts](/docs/{{version}}/encryption) the string: + +```php +use Illuminate\Support\Str; + +$encrypted = Str::of('secret')->encrypt(); +``` + +For the inverse of `encrypt`, see the [decrypt](#method-fluent-str-decrypt) method. + #### `endsWith` {.collection-method}