taskId = $taskId; $this->completed = $completed; } public function render() { return view('livewire.maintenance-task-status'); } public function toggleStatusAction(): Action { return Action::make('toggleStatus') ->label($this->completed ? __('Mark as In Progress') : __('Mark as Completed')) ->icon($this->completed ? 'heroicon-o-clock' : 'heroicon-o-check-circle') ->color($this->completed ? 'warning' : 'success') ->action(function () { $task = WebsiteMaintenanceTask::findOrFail($this->taskId); $task->update(['completed' => ! $this->completed]); $this->completed = ! $this->completed; }); } }