Added confirmation modal for enabling healtcheck + replaced enable checkbox with a button

This commit is contained in:
ShadowArcanist
2025-09-29 10:07:47 +05:30
parent 64af66ab94
commit 48ccfa3124
2 changed files with 22 additions and 3 deletions

View File

@@ -47,6 +47,18 @@ class HealthChecks extends Component
}
}
public function toggleHealthcheck()
{
try {
$this->authorize('update', $this->resource);
$this->resource->health_check_enabled = !$this->resource->health_check_enabled;
$this->resource->save();
$this->dispatch('success', 'Health check ' . ($this->resource->health_check_enabled ? 'enabled' : 'disabled') . '.');
} catch (\Throwable $e) {
return handleError($e, $this);
}
}
public function render()
{
return view('livewire.project.shared.health-checks');