From 5037497ada07f2c85960cbef5a31a90284707878 Mon Sep 17 00:00:00 2001
From: ShadowArcanist <162910371+ShadowArcanist@users.noreply.github.com>
Date: Sun, 29 Mar 2026 15:36:32 +0530
Subject: [PATCH] feat(ui): add enable/disable button for scheduled task
---
app/Livewire/Project/Shared/ScheduledTask/Show.php | 13 +++++++++++++
.../project/shared/scheduled-task/show.blade.php | 8 +++++---
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/app/Livewire/Project/Shared/ScheduledTask/Show.php b/app/Livewire/Project/Shared/ScheduledTask/Show.php
index d99cd9727..882737f09 100644
--- a/app/Livewire/Project/Shared/ScheduledTask/Show.php
+++ b/app/Livewire/Project/Shared/ScheduledTask/Show.php
@@ -111,6 +111,19 @@ public function syncData(bool $toModel = false)
}
}
+ public function toggleEnabled()
+ {
+ try {
+ $this->authorize('update', $this->resource);
+ $this->isEnabled = ! $this->isEnabled;
+ $this->task->enabled = $this->isEnabled;
+ $this->task->save();
+ $this->dispatch('success', $this->isEnabled ? 'Scheduled task enabled.' : 'Scheduled task disabled.');
+ } catch (\Exception $e) {
+ return handleError($e);
+ }
+ }
+
public function instantSave()
{
try {
diff --git a/resources/views/livewire/project/shared/scheduled-task/show.blade.php b/resources/views/livewire/project/shared/scheduled-task/show.blade.php
index 635b6c14b..1e727f6c3 100644
--- a/resources/views/livewire/project/shared/scheduled-task/show.blade.php
+++ b/resources/views/livewire/project/shared/scheduled-task/show.blade.php
@@ -11,6 +11,11 @@
Execute Now
@endif
+ @if (!$isEnabled)
+