Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SLegendary's avatar

Auto Update

I want to automatically update a Boolean status every time i load/reload my app if the time value on the row is past from the current date.

For example, my value time was 16:00 and now in current time it is 16:30 i want that the Boolean value changes from false to true.

protected function freeRoom()
    {
        $time = date('H:i:s');
        $meetings = Meetings::where('etime','<', $date)->update(['available' => 1]);
        return $meetings;
    }
0 likes
1 reply
MohamedTammam's avatar

Use whereTime

protected function freeRoom()
{
      $time = date('H:i:s');
      $meetings = Meetings::whereTime('etime', '<', $date)->update(['available' => 1]);
      return $meetings;
}

Please or to participate in this conversation.