public function vote($item, $type = 'up_vote')
    {
        $items = array_fill_keys((array) $this->checkVoteItem($item), ['type' => $type]);

        return $this->votedItems()->sync($items, false);
    }
public function vote($item, $type = 'up_vote')
    {
        $items = array_fill_keys((array) $this->checkVoteItem($item), ['type' => $type]);

        return $this->votedItems()->sync($items, false);
    }
public function vote ( $ item , $ type = 'up_vote' ) { $ items = array_fill_keys ( ( array ) $ this -> checkVoteItem ( $ item ) , [ 'type' => $ type ] ) ; return $ this -> votedItems ( ) -> sync ( $ items , false ) ; }
Vote a item or items.

@param  int|array|\Illuminate\Database\Eloquent\Model $item
@param  string $type
@return boolean
Vote a item or items .