public function hasParticipant($userId)
    {
        $participants = $this->participants()->where('user_id', '=', $userId);
        if ($participants->count() > 0) {
            return true;
        }

        return false;
    }
public function hasParticipant($userId)
    {
        $participants = $this->participants()->where('user_id', '=', $userId);
        if ($participants->count() > 0) {
            return true;
        }

        return false;
    }
public function hasParticipant ( $ userId ) { $ participants = $ this -> participants ( ) -> where ( 'user_id' , '=' , $ userId ) ; if ( $ participants -> count ( ) > 0 ) { return true ; } return false ; }
Checks to see if a user is a current participant of the thread.

@param int $userId

@return bool
Checks to see if a user is a current participant of the thread .