Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not change notification event name when broadcasting #30599

Closed
pkarczmarczyk94 opened this issue Nov 15, 2019 · 1 comment
Closed

Could not change notification event name when broadcasting #30599

pkarczmarczyk94 opened this issue Nov 15, 2019 · 1 comment

Comments

@pkarczmarczyk94
Copy link

pkarczmarczyk94 commented Nov 15, 2019

  • Laravel Version: 6.5.1
  • PHP Version: 7.3.9
  • Database Driver & Version: n/a

Description:

When trying to change notification event name with method broadcastType it has no effect. There is a method broadcastType in \Illuminate\Notifications\Events\BroadcastNotificationCreated but it does not change event name (I can see it in laravel-echo-server logs). In some point there was a method named 'broadcastAs' but it was changed to channelName ( \Illuminate\Notifications\Events\BroadcastNotificationCreated).
Commit where it was changed: 4227bd7

In \Illuminate\Broadcasting\BroadcastEvent::handle you still use broadcastAs to set event name.

So there are two ways either add broadcastAs method to \Illuminate\Notifications\Events\BroadcastNotificationCreated class that can be later overwritten in notification class or change broadcastAs to broadcastType in \Illuminate\Broadcasting\BroadcastEvent::handle.

For now, I do not see any way to change notification event's name on broadcasting channel.

There is also an issue about it #202

@taylorotwell

@driesvints
Copy link
Member

Closing because the PR was rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants