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

Support client events on Pusher presence channels #79

Merged
merged 2 commits into from
Jan 12, 2017

Conversation

tillkruss
Copy link
Contributor

@tillkruss tillkruss commented Jan 6, 2017

This PR adds a trigger() method onto the PusherPresenceChannel to trigger a client event.

This allows the browser to send events directly to Pusher, without having to go through Laravel. It's useful for events such as a "typing..." indicator or other events where it's overkill to pass them through Laravel. In my case it's when a user starts/stops broadcasting video.

See also: #47

@tillkruss tillkruss changed the title Added trigger method to PusherPresenceChannel Support client events on Pusher presence channels Jan 6, 2017
@taylorotwell
Copy link
Member

Should client- automatically be prefixed to the event name? Pusher requires them to start with that prefix.

@tillkruss
Copy link
Contributor Author

Sure, done!

@barryvdh
Copy link
Contributor

barryvdh commented Jan 9, 2017

Should we also implement this for laravel-echo-server and add it to the interface? (cc @tlaverdure )

@taylorotwell
Copy link
Member

I'm curious why this wasn't done on Private channels as well? Why only PresenceChannels?

@tillkruss
Copy link
Contributor Author

Because there is no pusher-private-channel.ts and I'm not quite sure how to add that file.

@taylorotwell
Copy link
Member

OK I'll look into adding that when I merge this.

@tillkruss
Copy link
Contributor Author

Thanks a lot!

@taylorotwell taylorotwell merged commit c10feff into laravel:master Jan 12, 2017
@taylorotwell
Copy link
Member

Added support for private channel.... renamed "trigger" to "whisper"... added "listenForWhisper" to help with listening for them.

Released as Echo 1.2.0.

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.

3 participants