From af441c65ec5ce982f42eec4de1bc2037c1616ee1 Mon Sep 17 00:00:00 2001 From: Italo Date: Tue, 8 Jul 2025 19:00:15 -0400 Subject: [PATCH 1/2] [12.x] Adds `whereValueBetween` documentation --- queries.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/queries.md b/queries.md index f2e66b085a..b49241b757 100644 --- a/queries.md +++ b/queries.md @@ -875,6 +875,24 @@ $patients = DB::table('patients') ->get(); ``` +**whereValueBetween / whereValueNotBetween / orWhereValueBetween / orWhereValueNotBetween** + +The `whereValueBetween` method verifies that a value is between the values of two columns of the same type in the same table row: + +```php +$patients = DB::table('patients') + ->whereValueBetween(100, ['minimum_allowed_weight', 'maximum_allowed_weight']) + ->get(); +``` + +The `whereValueNotBetween` method verifies that a value lies outside the values of two columns in the same table row: + +```php +$patients = DB::table('patients') + ->whereValueNotBetween(100, ['minimum_allowed_weight', 'maximum_allowed_weight']) + ->get(); +``` + **whereNull / whereNotNull / orWhereNull / orWhereNotNull** The `whereNull` method verifies that the value of the given column is `NULL`: From b845969cdf961b8a04bda779a6355ca2f1b2c21b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 9 Jul 2025 16:24:32 -0500 Subject: [PATCH 2/2] Update queries.md --- queries.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/queries.md b/queries.md index b49241b757..1e1096186e 100644 --- a/queries.md +++ b/queries.md @@ -877,19 +877,19 @@ $patients = DB::table('patients') **whereValueBetween / whereValueNotBetween / orWhereValueBetween / orWhereValueNotBetween** -The `whereValueBetween` method verifies that a value is between the values of two columns of the same type in the same table row: +The `whereValueBetween` method verifies that a given value is between the values of two columns of the same type in the same table row: ```php -$patients = DB::table('patients') - ->whereValueBetween(100, ['minimum_allowed_weight', 'maximum_allowed_weight']) +$patients = DB::table('products') + ->whereValueBetween(100, ['min_price', 'max_price']) ->get(); ``` The `whereValueNotBetween` method verifies that a value lies outside the values of two columns in the same table row: ```php -$patients = DB::table('patients') - ->whereValueNotBetween(100, ['minimum_allowed_weight', 'maximum_allowed_weight']) +$patients = DB::table('products') + ->whereValueNotBetween(100, ['min_price', 'max_price']) ->get(); ```