remove useless notification when admin create an account

This commit is contained in:
2026-02-24 16:04:26 +01:00
parent 2c4c1cf403
commit d77e3dc82b
+1 -11
View File
@@ -83,17 +83,6 @@ class UserController extends Controller
"phone" => $phone->formatInternational(),
]);
$notification = Notification::create([
'content' => "Nouvel utilisateur crée : {$user->name} {$user->lastname}",
]);
$admins = User::whereIn('role', [1, 2])->get();
$notification->users()->attach(
$admins->pluck('id')->toArray()
);
broadcast(new UserCreated($user));
return response()->json([
'message' => 'User created successfully',
"password" => $password,
@@ -188,6 +177,7 @@ class UserController extends Controller
try {
$user = User::find($id);
$content = "Nouvelle demande d'inscription : {$user->name} {$user->lastname}";
//$notification = Notification::where('user_id', $user->id)
$notification = Notification::where('content', $content)->first();
if ($notification) {