From e396059c7f820d871be8cafbec419b82666f5c28 Mon Sep 17 00:00:00 2001 From: Christian Raemy Date: Fri, 1 Mar 2024 16:39:05 +0100 Subject: [PATCH] fix the saving of the review date in the ActionplanController --- app/Http/Controllers/ActionplanController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ActionplanController.php b/app/Http/Controllers/ActionplanController.php index 713b98e3..62b936b5 100644 --- a/app/Http/Controllers/ActionplanController.php +++ b/app/Http/Controllers/ActionplanController.php @@ -57,8 +57,13 @@ public function save(Request $request) // save control $control = Control::find($id); $control->action_plan = request('action_plan'); - $control->plan_date = request('plan_date'); $control->update(); + + // save next control + $next_id = $control->next_id; + $next_control = Control::find($next_id); + $next_control->plan_date = request('plan_date'); + $next_control->update(); return redirect('/actions'); }