Skip to content

Commit eb77479

Browse files
authored
[5.4] Document Collection::uniqueStrict() method
Documents the feature added by laravel/framework#14661 Also updates the Collection::unique() documentation to outline its behavior and where they differ.
1 parent 6cf0ac5 commit eb77479

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

collections.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ For the remainder of this documentation, we'll discuss each method available on
110110
[transform](#method-transform)
111111
[union](#method-union)
112112
[unique](#method-unique)
113+
[uniqueStrict](#method-uniquestrict)
113114
[values](#method-values)
114115
[when](#method-when)
115116
[where](#method-where)
@@ -1369,6 +1370,13 @@ You may also pass your own callback to determine item uniqueness:
13691370
]
13701371
*/
13711372

1373+
The `unique` 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 `uniqueStrict` method to filter using "strict" comparisons.
1374+
1375+
<a name="method-uniquestrict"></a>
1376+
#### `uniqueStrict()` {#collection-method}
1377+
1378+
This method has the same signature as the `unique` method; however, all values are compared using "strict" comparisons.
1379+
13721380
<a name="method-values"></a>
13731381
#### `values()` {#collection-method}
13741382

0 commit comments

Comments
 (0)