Use each instead of map
This commit is contained in:
@@ -56,7 +56,7 @@ class SendComponentUpdateEmailNotificationHandler
|
||||
// First notify all global subscribers.
|
||||
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
|
||||
|
||||
$globalSubscribers->map(function ($subscriber) use ($component, $event) {
|
||||
$globalSubscribers->each(function ($subscriber) use ($component, $event) {
|
||||
$subscriber->notify(new ComponentStatusChangedNotification($component, $event->new_status));
|
||||
});
|
||||
|
||||
@@ -71,7 +71,7 @@ class SendComponentUpdateEmailNotificationHandler
|
||||
return in_array($subscriber->id, $notified);
|
||||
});
|
||||
|
||||
$componentSubscribers->map(function ($subscriber) use ($component, $event) {
|
||||
$componentSubscribers->each(function ($subscriber) use ($component, $event) {
|
||||
$subscriber->notify(new ComponentStatusChangedNotification($component, $event->new_status));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class SendIncidentEmailNotificationHandler
|
||||
// First notify all global subscribers.
|
||||
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
|
||||
|
||||
$globalSubscribers->map(function ($subscriber) use ($incident) {
|
||||
$globalSubscribers->each(function ($subscriber) use ($incident) {
|
||||
$subscriber->notify(new NewIncidentNotification($incident));
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@ class SendIncidentEmailNotificationHandler
|
||||
->get()
|
||||
->reject(function ($subscriber) use ($notified) {
|
||||
return in_array($subscriber->id, $notified);
|
||||
})->map(function ($subscriber) use ($incident) {
|
||||
})->each(function ($subscriber) use ($incident) {
|
||||
$subscriber->notify(new NewIncidentNotification($incident));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ class SendIncidentUpdateEmailNotificationHandler
|
||||
// First notify all global subscribers.
|
||||
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get();
|
||||
|
||||
$globalSubscribers->map(function ($subscriber) use ($update) {
|
||||
$globalSubscribers->each(function ($subscriber) use ($update) {
|
||||
$subscriber->notify(new IncidentUpdatedNotification($update));
|
||||
});
|
||||
|
||||
@@ -73,7 +73,7 @@ class SendIncidentUpdateEmailNotificationHandler
|
||||
->get()
|
||||
->reject(function ($subscriber) use ($notified) {
|
||||
return in_array($subscriber->id, $notified);
|
||||
})->map(function ($subscriber) use ($incident) {
|
||||
})->each(function ($subscriber) use ($incident) {
|
||||
$subscriber->notify(new IncidentUpdatedNotification($incident));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class SendScheduleEmailNotificationHandler
|
||||
$schedule = $event->schedule;
|
||||
|
||||
// First notify all global subscribers.
|
||||
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get()->map(function ($subscriber) use ($schedule) {
|
||||
$globalSubscribers = $this->subscriber->isVerified()->isGlobal()->get()->each(function ($subscriber) use ($schedule) {
|
||||
$subscriber->notify(new NewScheduleNotification($schedule));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user