Código PHP:
<?php
$poll->total_votes = intval($poll->total_votes, 10);
$voted_answer = Cookie::get('p_' . $poll->id . '_v');
if( ! $voted_answer ) {
$vote = Vote::where('voter_ip', '=', CURRENT_USER_IP)->and_where('poll_id', '=', (int) $poll->id)->first();
if( $vote ) {
$voted_answer = $vote->answer_id;
}
unset($vote);
}
?>