insertOrIgnore([ 'poll_id' => $option->poll_id, 'poll_option_id' => $option->id, 'user_id' => $user->id, 'created_at' => now(), 'updated_at' => now(), ]) === 1; // Results stay hidden from whoever hasn't voted, so the update only says to read them again. if ($voted) { event(new CommitsUpdated(Commit::query()->approved()->whereRelation('poll', 'id', $option->poll_id)->get(['id']), CommitUpdate::Poll)); } return $voted; } }