Use each and always fire the event
This commit is contained in:
@@ -50,7 +50,7 @@ class SubscribeSubscriberCommandHandler
|
||||
$components = Component::all();
|
||||
}
|
||||
|
||||
$components->map(function ($component) use ($subscriber) {
|
||||
$components->each(function ($component) use ($subscriber) {
|
||||
Subscription::create([
|
||||
'subscriber_id' => $subscriber->id,
|
||||
'component_id' => $component->id,
|
||||
@@ -61,10 +61,10 @@ class SubscribeSubscriberCommandHandler
|
||||
dispatch(new VerifySubscriberCommand($subscriber));
|
||||
} else {
|
||||
$subscriber->notify(new VerifySubscriptionNotification());
|
||||
|
||||
event(new SubscriberHasSubscribedEvent($subscriber));
|
||||
}
|
||||
|
||||
event(new SubscriberHasSubscribedEvent($subscriber));
|
||||
|
||||
$subscriber->load('subscriptions');
|
||||
|
||||
return $subscriber;
|
||||
|
||||
Reference in New Issue
Block a user