authorize('deleteClient', Auth::user()); $deletedClient = Client::findOrFail($payload); if ($deletedClient) { $deletedClient->delete(); } // Sucesso (Dentro do try, onde deve estar) $this->dispatch('client-deleted'); $this->dispatch('notify', message: 'Cliente excluído com sucesso!'); } catch (Exception $e) { // Tratamento de erro $this->dispatch('notify', message: 'Você não possui permissão para realizar essa ação.', type: 'error'); } } public function render() { return '
'; } }