You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clarify where(), whereNull(), and whereNotNull() usage (#10814)
this change helps clarify usage of the `where()`, `whereNull()`, and `whereNotNull()` methods with a `null` value.
discourage the use of `$collection->where('field', '!=', null)` because it will possibly cause unexpected results with "nully" values.
show more values that are "nully" and how they will be treated with the strict check.
Copy file name to clipboardExpand all lines: collections.md
+22-7Lines changed: 22 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3745,25 +3745,25 @@ $filtered->all();
3745
3745
*/
3746
3746
```
3747
3747
3748
-
The `where` 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 [whereStrict](#method-wherestrict) method to filter using "strict" comparisons.
3748
+
The `where` 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 [whereStrict](#method-wherestrict) method to filter using "strict" comparisons, or the [whereNull](#method-wherenull) and [whereNotNull](#method-wherenotnull) methods to filter for `null` values.
3749
3749
3750
3750
Optionally, you may pass a comparison operator as the second parameter. Supported operators are: '===', '!==', '!=', '==', '=', '<>', '>', '<', '>=', and '<=':
0 commit comments