If user information is not provided in a system update (for example when users update), then dont zap system_users

This commit is contained in:
Deon George 2023-12-20 17:18:10 +11:00
parent 9376c6de11
commit c1a1797778

View File

@ -49,10 +49,12 @@ class SystemController extends Controller
->transform(function($item) { $item['active'] = Arr::get($item,'active',FALSE); return $item; }); ->transform(function($item) { $item['active'] = Arr::get($item,'active',FALSE); return $item; });
$o->mailers()->sync($mailers); $o->mailers()->sync($mailers);
if ($request->post('users') && array_filter($request->post('users'),function($item) { return $item; })) if ($request->post('users')) {
if (array_filter($request->post('users'),function($item) { return $item; }))
$o->users()->sync($request->post('users')); $o->users()->sync($request->post('users'));
else else
$o->users()->detach(); $o->users()->detach();
}
return redirect()->to('system'); return redirect()->to('system');
} }