From e75be34afd8818e57b65f20de3fb46795395af82 Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 4 Oct 2023 15:58:46 +1100 Subject: [PATCH] Detach users when deleting a system --- app/Http/Controllers/SystemController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/SystemController.php b/app/Http/Controllers/SystemController.php index 3e26786..6c55a55 100644 --- a/app/Http/Controllers/SystemController.php +++ b/app/Http/Controllers/SystemController.php @@ -678,6 +678,7 @@ class SystemController extends Controller if (Arr::get($validated,'remove')) { $so->sessions()->detach($o->zone); $so->mailers()->detach(); + $so->users()->detach(); $so->delete(); } elseif (Arr::get($validated,'remsess')) {