getPleb(); if (! $pleb) { return false; } return ! Vote::query() ->where('project_proposal_id', $projectProposal->id) ->where('einundzwanzig_pleb_id', $pleb->id) ->exists(); } /** * Determine whether the user can update the vote. * Only the vote owner can update their vote. */ public function update(NostrUser $user, Vote $vote): bool { $pleb = $user->getPleb(); if (! $pleb) { return false; } return $pleb->id === $vote->einundzwanzig_pleb_id; } /** * Determine whether the user can delete the vote. * Only the vote owner can delete their vote. */ public function delete(NostrUser $user, Vote $vote): bool { $pleb = $user->getPleb(); if (! $pleb) { return false; } return $pleb->id === $vote->einundzwanzig_pleb_id; } }