Skip to content

Commit b346638

Browse files
authored
Document Collection::containsStrict() method
Documents the feature added by laravel/framework#14657 Also updates the Collection::contains() documentation to outline its behavior and where they differ.
1 parent 6cf0ac5 commit b346638

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

collections.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ For the remainder of this documentation, we'll discuss each method available on
5353
[collapse](#method-collapse)
5454
[combine](#method-combine)
5555
[contains](#method-contains)
56+
[containsStrict](#method-containsstrict)
5657
[count](#method-count)
5758
[diff](#method-diff)
5859
[diffKeys](#method-diffkeys)
@@ -249,6 +250,12 @@ Finally, you may also pass a callback to the `contains` method to perform your o
249250

250251
// false
251252

253+
The `contains` method uses "loose" comparisons when checking item values, meaning a string with an integer value will be considered equal to an integer of the same value. Use the `containsStrict` method to filter using "strict" comparisons.
254+
255+
#### `containsStrict()` {#collection-method}
256+
257+
This method has the same signature as the `contains` method; however, all values are compared using "strict" comparisons.
258+
252259
<a name="method-count"></a>
253260
#### `count()` {#collection-method}
254261

0 commit comments

Comments
 (0)