remove useless notification when admin create an account
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user