Detach users when deleting a system

This commit is contained in:
Deon George 2023-10-04 15:58:46 +11:00
parent d82f8ac8b3
commit e75be34afd

View File

@ -678,6 +678,7 @@ class SystemController extends Controller
if (Arr::get($validated,'remove')) { if (Arr::get($validated,'remove')) {
$so->sessions()->detach($o->zone); $so->sessions()->detach($o->zone);
$so->mailers()->detach(); $so->mailers()->detach();
$so->users()->detach();
$so->delete(); $so->delete();
} elseif (Arr::get($validated,'remsess')) { } elseif (Arr::get($validated,'remsess')) {