preferences['defaultGroup'] == $event->group->id) { $user['preferences->defaultGroup'] = 0; } if ($user->preferences['activeGroup'] == $event->group->id) { $user['preferences->activeGroup'] = 0; } if ($user->isDirty()) { $user->save(); Log::info(sprintf('Group %s (id #%d) removed from user %s (id #%d) preferences', var_export($event->group->name, true), $event->group->id, var_export($user->name, true), $user->id)); } } } }