app/Models/WorkOrder.php
public function closeSessions()
    {
        $closed = [];

        foreach ($this->sessions as $session) {
            if ($session instanceof WorkOrderSession && is_null($session->out)) {
                $session->out = $this->freshTimestamp();

                if ($session->save()) {
                    $closed[] = $session;
                }
            }
        }

        return $closed;
    }
public function closeSessions()
    {
        $closed = [];

        foreach ($this->sessions as $session) {
            if ($session instanceof WorkOrderSession && is_null($session->out)) {
                $session->out = $this->freshTimestamp();

                if ($session->save()) {
                    $closed[] = $session;
                }
            }
        }

        return $closed;
    }
Closes all sessions on the current work order.

@return array