diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index a4cb5cc..2f2895e 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -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) {