Skip to content

Commit

Permalink
fix broadcast as
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 4, 2023
1 parent 1cdace4 commit 108f015
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function broadcastType()
public function broadcastAs()
{
return method_exists($this->notification, 'broadcastAs')
? $this->notification->broadcastAs()
: get_class($this->notification);
? $this->notification->broadcastAs()
: __CLASS__;

This comment has been minimized.

Copy link
@kvas-damian

kvas-damian Jan 10, 2024

@taylorotwell hardcoding __CLASS__ here, breaks backwards compatibility.

We're migrating from Laravel 9.x. We have an MyEvent which inherits from BroadcastNotificationCreated. After this change we get BroadcastNotificationCreated as event name instead of MyEvent which was calculated in Laravel 9.x.

According to my understanding, before #48136 the code that was providing the name sits here: https://github.com/laravel/framework/blob/10.x/src/Illuminate/Broadcasting/BroadcastEvent.php#L76-L77 so using get_class($this) should solve backwards incompatibility problem.

What do you think? Should I create a PR?

}
}

0 comments on commit 108f015

Please sign in to comment.