Skip to content

Commit e473f8c

Browse files
[12.x] Adds whereValueBetween documentation (#10587)
* [12.x] Adds `whereValueBetween` documentation * Update queries.md --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 3fd8aad commit e473f8c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

queries.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,24 @@ $patients = DB::table('patients')
875875
->get();
876876
```
877877

878+
**whereValueBetween / whereValueNotBetween / orWhereValueBetween / orWhereValueNotBetween**
879+
880+
The `whereValueBetween` method verifies that a given value is between the values of two columns of the same type in the same table row:
881+
882+
```php
883+
$patients = DB::table('products')
884+
->whereValueBetween(100, ['min_price', 'max_price'])
885+
->get();
886+
```
887+
888+
The `whereValueNotBetween` method verifies that a value lies outside the values of two columns in the same table row:
889+
890+
```php
891+
$patients = DB::table('products')
892+
->whereValueNotBetween(100, ['min_price', 'max_price'])
893+
->get();
894+
```
895+
878896
**whereNull / whereNotNull / orWhereNull / orWhereNotNull**
879897

880898
The `whereNull` method verifies that the value of the given column is `NULL`:

0 commit comments

Comments
 (0)