authorize('delete', $this->server); if (!$this->server->isEmpty()) { $this->emit('error', 'Server has defined resources. Please delete them first.'); return; } $this->server->delete(); return redirect()->route('server.all'); } catch (\Throwable $e) { return handleError($e, $this); } } public function render() { return view('livewire.server.delete'); } }