Giter VIP home page Giter VIP logo

Comments (7)

morloderex avatar morloderex commented on July 20, 2024

@petervmeijgaard Have you looked at the docs for echo?
The method you should use is called join. not presence.

from echo.

petervmeijgaard avatar petervmeijgaard commented on July 20, 2024

Yes, I have.
From https://laravel.com/docs/master/broadcasting#presence-channels :

To join a presence channel, you may use Echo's presence method. The presence method will return a PresenceChannel implementation which, along with exposing the listen method, allows you to subscribe to the here, joining, and leaving events.

Echo.presence('chat.' + roomId)
    .here((users) => {
        //
    })
    .joining((user) => {
        console.log(user.name);
    })
    .leaving((user) => {
        console.log(user.name);
    });

from echo.

morloderex avatar morloderex commented on July 20, 2024

@petervmeijgaard Well that might be an issue with the documentation.
Because in the source it looks like the method is called join not presence.

ping @taylorotwell

from echo.

petervmeijgaard avatar petervmeijgaard commented on July 20, 2024

Yeah, exactly :) It confused me and I had to check the Laracast about Echo to be sure.

from echo.

tlaverdure avatar tlaverdure commented on July 20, 2024

I've been using join() and not presence(). @taylorotwell is this maybe a typo in the docs, or you thinking about changing the name to avoid confusing join() an joining()?

from echo.

petervmeijgaard avatar petervmeijgaard commented on July 20, 2024

Ah I saw that the documentation has been updated. It's join() and nog presence().

Thanks @taylorotwell 👍

from echo.

petervmeijgaard avatar petervmeijgaard commented on July 20, 2024

Fixed in: laravel/docs@5ddcf2f

from echo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.