Skip to content

Commit 4d2579e

Browse files
authored
Add an example for whereIn with JSON column types. (#10654)
1 parent 07067a6 commit 4d2579e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

queries.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,10 @@ Laravel also supports querying JSON column types on databases that provide suppo
696696
$users = DB::table('users')
697697
->where('preferences->dining->meal', 'salad')
698698
->get();
699+
700+
$users = DB::table('users')
701+
->whereIn('preferences->dining->meal', ['pasta', 'salad', 'sandwiches'])
702+
->get();
699703
```
700704

701705
You may use the `whereJsonContains` and `whereJsonDoesntContain` methods to query JSON arrays:

0 commit comments

Comments
 (0)