refactor: use mass assignment for user settings

This commit is contained in:
Roardom
2023-06-23 07:42:49 +00:00
parent d9ba25951a
commit 4d16bc08df
9 changed files with 47 additions and 43 deletions

View File

@@ -119,8 +119,9 @@ class NotificationSettingController extends Controller
$notification->json_mention_groups = array_map('intval', $request->json_mention_groups ?? []);
$notification->save();
$user->block_notifications = $request->block_notifications;
$user->save();
$user->update([
'block_notifications' => $request->block_notifications,
]);
return to_route('users.notification_settings.edit', ['user' => $user])
->withSuccess('Your notification settings have been successfully saved.');