From fab42949dc2827422e0c9454f3604ac96d77e50f Mon Sep 17 00:00:00 2001 From: sdbondi Date: Tue, 30 Oct 2012 09:08:51 +0200 Subject: [PATCH] Added documentation for where_between suite of methods Signed-off-by: sdbondi --- laravel/documentation/database/fluent.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/laravel/documentation/database/fluent.md b/laravel/documentation/database/fluent.md index ceeb809b..fe37e361 100644 --- a/laravel/documentation/database/fluent.md +++ b/laravel/documentation/database/fluent.md @@ -114,6 +114,26 @@ ### where\_null, where\_not\_null, or\_where\_null, and or\_where\_not\_null ->or_where_not_null('updated_at') ->get(); +### where\_between, where\_not\_between, or\_where\_between, and or\_where\_not\_between + +The suite of **where_between** methods makes checking if values fall BETWEEN a minimum and maximum super easy : + + return DB::table('users')->where_between($column, $min, $max)->get(); + + return DB::table('users')->where_between('updated_at', '2000-10-10', '2012-10-10')->get(); + + return DB::table('users')->where_not_between('updated_at', '2000-10-10', '2012-01-01')->get(); + + return DB::table('users') + ->where('email', '=', 'example@gmail.com') + ->or_where_between('updated_at', '2000-10-10', '2012-01-01') + ->get(); + + return DB::table('users') + ->where('email', '=', 'example@gmail.com') + ->or_where_not_between('updated_at', '2000-10-10', '2012-01-01') + ->get(); + ## Nested Where Clauses