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

No connection for Global content #47

Open
mikemartin opened this issue Aug 10, 2021 · 4 comments · May be fixed by #97
Open

No connection for Global content #47

mikemartin opened this issue Aug 10, 2021 · 4 comments · May be fixed by #97
Labels
bug Something isn't working

Comments

@mikemartin
Copy link

It seems collaboration does not work for Global content. Perhaps this is because the content is structured differently and stored in the data array?

Screen Shot 2021-08-10 at 4 02 53 pm

@duncan412
Copy link

To expand a little bit on this, the auth ajax request throws an 403 error.

@ben182
Copy link

ben182 commented Jun 26, 2022

Hi, as a workaround, put this in the boot method of any service provider:

Broadcast::channel('globals.{id}.{site}', function ($user, $id, $site) {
    return [
        'name' => $user->name(),
        'id' => $user->id(),
        'title' => $user->title(),
        'email' => $user->email(),
        'avatar' => $user->avatar(),
        'initials' => $user->initials(),
    ];
});

@theutz
Copy link
Contributor

theutz commented Nov 9, 2023

Running into this problem, too, but the workaround doesn't seem to be working.

@theutz
Copy link
Contributor

theutz commented Nov 9, 2023

Running into this problem, too, but the workaround doesn't seem to be working.

Upon further investigation, it seems that the front-end is looking for a channel with four segments: globals.{set}.{id}.{site}. I assume, at least, that this is what each of the segments mean.

- Broadcast::channel('globals.{id}.{site}', function ($user, $id, $site) {
+ Broadcast::channel('globals.{set}.{id}.{site}', function ($user, $set, $id, $site) {

So, to updated @ben182 's helpful comment from before, you might need to put the following in routes/channels.php if you have it, or in the boot method of the BroadcastServiceProvider:

Broadcast::channel('globals.{set}.{id}.{site}', function ($user, $set, $id, $site) {
    return [
        'name' => $user->name(),
        'id' => $user->id(),
        'title' => $user->title(),
        'email' => $user->email(),
        'avatar' => $user->avatar(),
        'initials' => $user->initials(),
    ];
});

@duncanmcclean duncanmcclean added the bug Something isn't working label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants