public function complete($statusId)
    {
        if (is_null($this->started_at)) {
            $this->started_at = $this->freshTimestamp();
        }

        $this->completed_at = $this->freshTimestamp();
        $this->status_id = $statusId;

        return $this->save();
    }
public function complete($statusId)
    {
        if (is_null($this->started_at)) {
            $this->started_at = $this->freshTimestamp();
        }

        $this->completed_at = $this->freshTimestamp();
        $this->status_id = $statusId;

        return $this->save();
    }
public function complete ( $ statusId ) { if ( is_null ( $ this -> started_at ) ) { $ this -> started_at = $ this -> freshTimestamp ( ) ; } $ this -> completed_at = $ this -> freshTimestamp ( ) ; $ this -> status_id = $ statusId ; return $ this -> save ( ) ; }
Completes the work order by saving the completed at timestamp to now.

@param int|string $statusId

@return $this|bool
Completes the work order by saving the completed at timestamp to now .