Skip to content

Commit f0bf683

Browse files
Raphael CanguçuRaphael Cangucu
andauthored
[10.x] Add broadcastAs function at BroadcastNotificationCreated (#48136)
* Add broadcastas function at BroadcastNotificationCreated, so it will get from the notification. * Remove duplicate ; --------- Co-authored-by: Raphael Cangucu <[email protected]>
1 parent 7f287ed commit f0bf683

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,16 @@ public function broadcastType()
120120
? $this->notification->broadcastType()
121121
: get_class($this->notification);
122122
}
123+
124+
/**
125+
* Get the event name of the notification being broadcast.
126+
*
127+
* @return string
128+
*/
129+
public function broadcastAs()
130+
{
131+
return method_exists($this->notification, 'broadcastAs')
132+
? $this->notification->broadcastAs()
133+
: get_class($this->notification);
134+
}
123135
}

0 commit comments

Comments
 (0)