public function hasGroup($associated) : bool
    {
        $associated_id = $associated instanceof $this ? $associated->id : $associated;

        return !! $this->group()->where('associated_id', $associated_id)->exists();
    }
public function hasGroup($associated) : bool
    {
        $associated_id = $associated instanceof $this ? $associated->id : $associated;

        return !! $this->group()->where('associated_id', $associated_id)->exists();
    }
public function hasGroup ( $ associated ) : bool { $ associated_id = $ associated instanceof $ this ? $ associated -> id : $ associated ; return ! ! $ this -> group ( ) -> where ( 'associated_id' , $ associated_id ) -> exists ( ) ; }
Checks whether the given product has the associated product in its group.

@param  self|int $associated

@return boolean
Checks whether the given product has the associated product in its group .