From f41b81cf5eef20f1b4fd567e3d72b31ff0f8e40c Mon Sep 17 00:00:00 2001 From: Samiullah Sediqzada Date: Tue, 4 Nov 2025 15:04:37 +0430 Subject: [PATCH 1/3] document fluent string deosntContain method --- strings.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/strings.md b/strings.md index c19c9f675f..a87b73b5aa 100644 --- a/strings.md +++ b/strings.md @@ -2296,6 +2296,39 @@ $string = Str::of('/foo/bar/baz')->dirname(2); // '/foo' ``` + +#### `Str::doesntContain()` {.collection-method} + +The `Str::doesntContain` method determines if the given string does not contain the given value. This method is the inverse of the `contains` method. By default, this method is case sensitive: + +```php +use Illuminate\Support\Str; + +$doesntContain = Str::of('This is my name')->doesntContain('my'); + +// false +``` + +You may also pass an array of values to determine if the given string does not contain any of the values in the array: + +```php +use Illuminate\Support\Str; + +$doesntContain = Str::of('This is my name')->doesntContain(['my', 'foo']); + +// false +``` + +You may disable case sensitivity by setting the ignoreCase argument to true: + +```php +use Illuminate\Support\Str; + +$doesntContain = Str::of('This is my name')->doesntContain('MY', ignoreCase: true); + +// false +``` + #### `doesntEndWith` {.collection-method} From d53dcaf93e2f8528a36adf22d060bccfd21eb8b6 Mon Sep 17 00:00:00 2001 From: Samiullah Sediqzada Date: Wed, 5 Nov 2025 09:53:23 +0430 Subject: [PATCH 2/3] add ToC for Stringable doesntContain docs --- strings.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/strings.md b/strings.md index a87b73b5aa..b22e45598e 100644 --- a/strings.md +++ b/strings.md @@ -151,6 +151,7 @@ Laravel includes a variety of functions for manipulating string values. Many of [decrypt](#method-fluent-str-decrypt) [deduplicate](#method-fluent-str-deduplicate) [dirname](#method-fluent-str-dirname) +[doesntContain](#method-fluent-str-doesnt-contain) [doesntEndWith](#method-fluent-str-doesnt-end-with) [doesntStartWith](#method-fluent-str-doesnt-start-with) [encrypt](#method-fluent-str-encrypt) @@ -2296,10 +2297,10 @@ $string = Str::of('/foo/bar/baz')->dirname(2); // '/foo' ``` - -#### `Str::doesntContain()` {.collection-method} + +#### `doesntContain()` {.collection-method} -The `Str::doesntContain` method determines if the given string does not contain the given value. This method is the inverse of the `contains` method. By default, this method is case sensitive: +The `doesntContain` method determines if the given string does not contain the given value. This method is the inverse of the [contains](#method-fluent-str-contains) method. By default, this method is case sensitive: ```php use Illuminate\Support\Str; From fa2b93854e81490763fd94795159123a50c2b5fc Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 5 Nov 2025 09:21:10 -0600 Subject: [PATCH 3/3] formatting --- strings.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/strings.md b/strings.md index b22e45598e..3eb1276171 100644 --- a/strings.md +++ b/strings.md @@ -550,7 +550,7 @@ You may also pass an array of values to determine if the given string doesn't co ```php use Illuminate\Support\Str; -$doesntContain = Str::doesntContain('This is name', ['my', 'foo']); +$doesntContain = Str::doesntContain('This is name', ['my', 'framework']); // true ``` @@ -2305,9 +2305,9 @@ The `doesntContain` method determines if the given string does not contain the g ```php use Illuminate\Support\Str; -$doesntContain = Str::of('This is my name')->doesntContain('my'); +$doesntContain = Str::of('This is name')->doesntContain('my'); -// false +// true ``` You may also pass an array of values to determine if the given string does not contain any of the values in the array: @@ -2315,19 +2315,19 @@ You may also pass an array of values to determine if the given string does not c ```php use Illuminate\Support\Str; -$doesntContain = Str::of('This is my name')->doesntContain(['my', 'foo']); +$doesntContain = Str::of('This is name')->doesntContain(['my', 'framework']); -// false +// true ``` -You may disable case sensitivity by setting the ignoreCase argument to true: +You may disable case sensitivity by setting the `ignoreCase` argument to `true`: ```php use Illuminate\Support\Str; $doesntContain = Str::of('This is my name')->doesntContain('MY', ignoreCase: true); -// false +// true ```