public function hasVoted($item, $type = null)
    {
        $item = $this->checkVoteItem($item);

        $votedItems = $this->votedItems();

        if(!is_null($type)) $votedItems->wherePivot('type', $type);

        return $votedItems->get()->contains($item);
    }
public function hasVoted($item, $type = null)
    {
        $item = $this->checkVoteItem($item);

        $votedItems = $this->votedItems();

        if(!is_null($type)) $votedItems->wherePivot('type', $type);

        return $votedItems->get()->contains($item);
    }
public function hasVoted ( $ item , $ type = null ) { $ item = $ this -> checkVoteItem ( $ item ) ; $ votedItems = $ this -> votedItems ( ) ; if ( ! is_null ( $ type ) ) $ votedItems -> wherePivot ( 'type' , $ type ) ; return $ votedItems -> get ( ) -> contains ( $ item ) ; }
Check if user has voted item.

@param $item
@param string $type

@return bool
Check if user has voted item .