currentTeam(); if (! $team) { return []; } return [ "echo-private:team.{$team->id},ServiceChecked" => 'refreshResource', ]; } public function refreshResource(): void { $this->resource->refresh(); } public function restart(): void { try { $this->authorize('update', $this->service); $this->resource->restart(); $message = $this->resource instanceof ServiceApplication ? 'Service application restarted successfully.' : 'Service database restarted successfully.'; $this->dispatch('success', $message); } catch (\Throwable $e) { handleError($e, $this); } } public function render(): View { return view('livewire.project.service.resource-card', [ 'isApplication' => $this->resource instanceof ServiceApplication, 'isDatabase' => $this->resource instanceof ServiceDatabase, ]); } }