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

[5.3] A notification can be broadcasted to custom channels #16170

Merged
merged 2 commits into from
Oct 31, 2016

Conversation

shadoWalker89
Copy link
Contributor

@shadoWalker89 shadoWalker89 commented Oct 29, 2016

This PR will allow to specify the channels to broadcast to, upon overriding the broadcastOn() on a notification.

class ProductPurchased extends Notification implements ShouldQueue
{
    public function broadcastOn()
    {
        return [
            new PrivateChannel('sales'),
            new PrivateChannel('accountant'),
            new PrivateChannel('admin')
        ];
    }
}

@GrahamCampbell GrahamCampbell changed the title A notification can be broadcasted to custom channels [5.3] A notification can be broadcasted to custom channels Oct 29, 2016
@shadoWalker89
Copy link
Contributor Author

On second thought maybe it would be better if we use routeNotificationForBroadcast() to define custom channels instead of overriding the broadcastOn(). Just to be consistent with the other Channels.

If you like we can even keep them both.
What do you think @taylorotwell ?

@taylorotwell taylorotwell merged commit 174490b into laravel:5.3 Oct 31, 2016
@shadoWalker89 shadoWalker89 deleted the notification_broadcast_on branch October 31, 2016 15:55
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

Successfully merging this pull request may close these issues.

None yet

2 participants