public function touchLastSeen()
    {
        if ($this->isOnline()) {
            return;
        }

        $oldTimestamps = $this->timestamps;
        $this->timestamps = false;

        $this
            ->newQuery()
            ->where('id', $this->id)
            ->update(['last_seen' => $this->freshTimestamp()])
        ;

        $this->last_seen = $this->freshTimestamp();
        $this->timestamps = $oldTimestamps;
    }
public function touchLastSeen()
    {
        if ($this->isOnline()) {
            return;
        }

        $oldTimestamps = $this->timestamps;
        $this->timestamps = false;

        $this
            ->newQuery()
            ->where('id', $this->id)
            ->update(['last_seen' => $this->freshTimestamp()])
        ;

        $this->last_seen = $this->freshTimestamp();
        $this->timestamps = $oldTimestamps;
    }
public function touchLastSeen ( ) { if ( $ this -> isOnline ( ) ) { return ; } $ oldTimestamps = $ this -> timestamps ; $ this -> timestamps = false ; $ this -> newQuery ( ) -> where ( 'id' , $ this -> id ) -> update ( [ 'last_seen' => $ this -> freshTimestamp ( ) ] ) ; $ this -> last_seen = $ this -> freshTimestamp ( ) ; $ this -> timestamps = $ oldTimestamps ; }
Checks if the user has been seen in the last 5 minutes, and if not,
updates the last_seen timestamp to reflect their online status.
@return void
Checks if the user has been seen in the last 5 minutes and if not updates the last_seen timestamp to reflect their online status .