From bb44c1a2162415c803d97002eb5f757af3a5e501 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 25 Jul 2022 23:50:46 +1000 Subject: [PATCH] Hack to make services active when changed after ordering --- app/Http/Controllers/ServiceController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/ServiceController.php b/app/Http/Controllers/ServiceController.php index 191be79..467c051 100644 --- a/app/Http/Controllers/ServiceController.php +++ b/app/Http/Controllers/ServiceController.php @@ -123,6 +123,7 @@ class ServiceController extends Controller /** * Change the status of a service + * @todo This needs to be optimized * * @note This route is protected by middleware @see ServicePolicy::progress() * It is assumed that the next stage is valid for the services current stage - validated in ServicePolicy::progress() @@ -172,6 +173,10 @@ class ServiceController extends Controller } else { $o->order_status = $stage; + + if ($stage == 'ACTIVE') + $o->active = TRUE; + $o->save(); }