异常:照亮\ Broadcasting \ BroadcastException PusherBroadcaster.php:119中没有消息 [英] Exception: Illuminate \ Broadcasting \ BroadcastException No message in PusherBroadcaster.php:119

查看:109
本文介绍了异常:照亮\ Broadcasting \ BroadcastException PusherBroadcaster.php:119中没有消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Laravel 5.8

Laravel 5.8

我对整个推送器功能还是陌生的,我一直在遵循本教程并对其进行尝试,

I am new to this whole pusher functionality and I've been following this tutorial and trying it out,

使用Laravel和Pusher渠道创建Web通知.

我已按照步骤进行操作,当我进入访问测试网址以手动测试事件的步骤时,会收到以下异常:

I've followed it step-by-step and when I get to the step to manually test the event by visiting the test url, I receive the following exception:

照亮\广播\ BroadcastException 没有消息

Illuminate \ Broadcasting \ BroadcastException No message

C:\ wamp \ www \ ares \ vendor \ laravel \ framework \ src \ Illuminate \ Broadcasting \ Broadcasters \ PusherBroadcaster.php

C:\wamp\www\ares\vendor\laravel\framework\src\Illuminate\Broadcasting\Broadcasters\PusherBroadcaster.php

这是代码:

    $response = $this->pusher->trigger(
        $this->formatChannels($channels), $event, $payload, $socket, true
    );

    if ((is_array($response) && $response['status'] >= 200 && $response['status'] <= 299)
        || $response === true) {
        return;
    }

    throw new BroadcastException( // <-- Exception at this line
        is_bool($response) ? 'Failed to connect to Pusher.' : $response['body']
    );
}

/**
 * Get the Pusher SDK instance.
 *
 * @return \Pusher\Pusher
 */
public function getPusher()
{
    return $this->pusher;
}
}

我看过其他一些有关堆栈溢出的文章,这些文章讨论了将encrypted: true更改为encrypted: false的问题,但这似乎没有任何影响.

I've looked at a few other stack overflow articles which talk about changing encrypted: true to encrypted: false but that does not seem to affect anything.

推荐答案

如果您正在使用localhost,请尝试设置.env文件.

If you're working on localhost try setting your .env file.

设置:

APP_URL=http://localhost

DB_HOST=localhost

并运行

php artisan config:cache

这篇关于异常:照亮\ Broadcasting \ BroadcastException PusherBroadcaster.php:119中没有消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆