Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Can subscribe to all channel types except Presence #1008

Answered by garrettboone
garrettboone asked this question in Q&A
Discussion options

You must be logged in to vote

I figued it out - the returned channel_data had a colon in front of it.

I also needed to change the double json encoding of the $channel_data to just one time otherwise I was getting error:

   TypeError

  Cannot access offset of type string on string

  at vendor/beyondcode/laravel-websockets/src/WebSockets/Channels/PresenceChannel.php:36

Custom auth code is now:

    public function pusherAuth(Request $request)
    {
        // implmenting pusher feature of authenticating private/presence channel messages
        // see https://pusher.com/docs/channels/library_auth_reference/auth-signatures/
        if(!$request->socket_id || !$request->channel_name) {
            return response()->jso…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by garrettboone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant