'find record between start and close time (in next day) in Laravel
I have two column "start_time" & "close_time" type "Time" in mysql.
My query is working fine when
| start_time | close_time | status |
|---|---|---|
| 07:00:00 | 22:00:00 | Active |
but when the time is two different days like from 10 PM to 7 Am next morning in the database it is stored like below
| start_time | close_time | status |
|---|---|---|
| 22:00:00 | 7:00:00 | Active |
My Eloquent Query works fine for same-day opening and close time
TaxiStand::whereHas('nightTime',function ($qu) {
$qu->whereTime('start_time','<=', now('Europe/Berlin')->format('H:i:s'))->whereTime('end_time','>=',now()->format('H:i:s'));
})->where('operation_mode',true)->where('active',false)->update(['status'=>true]);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
