remove unecessary delete notifications on validate user

This commit is contained in:
2026-03-12 11:01:44 +01:00
parent d2dd44af4d
commit c16a9d1785
2 changed files with 0 additions and 52 deletions
-8
View File
@@ -183,13 +183,6 @@ class UserController extends Controller
try {
$user = User::find($id);
$notifications = Notification::where('user_id', $user->id)->get();
foreach ($notifications as $notification) {
$notification->users()->detach();
$notification->delete();
}
$user->validate = 1;
$user->role = 3;
$user->verified_at = now();
@@ -201,7 +194,6 @@ class UserController extends Controller
'lastname' => $user->lastname,
];
Mail::to($user->email)->send(new ValidateMail($data));
broadcast(new UserValidated($user));
return response()->json(['message' => 'User validated successfully']);