where('tokenable_type', Auth::user()::class) ->findOrFail($tokenId); $this->tokenId = $tokenId; $this->tokenName = $token->name; } public function delete(): void { PersonalAccessToken::where('tokenable_id', Auth::id()) ->where('tokenable_type', Auth::user()::class) ->findOrFail($this->tokenId) ->delete(); $this->dispatch('toast', type: 'done', badge: 'API Key', title: 'Gelöscht', text: "Key {$this->tokenName} wurde entfernt.", duration: 4000); $this->dispatch('token-deleted'); $this->closeModal(); } public function render() { return view('livewire.ui.system.modal.api-key-delete-modal'); } }