findOrFail($invitation_id); $user = User::whereEmail($invitation->email)->first(); if (filled($user)) { $user->deleteIfNotVerifiedAndForcePasswordReset(); } $invitation->delete(); $this->refreshInvitations(); $this->dispatch('success', 'Invitation revoked.'); } catch (\Exception) { return $this->dispatch('error', 'Invitation not found.'); } } public function refreshInvitations() { $this->invitations = TeamInvitation::ownedByCurrentTeam()->get(); } }