Php 为什么是拉维公司;Pusher不在本地主机上工作,但在生产环境下工作?

Php 为什么是拉维公司;Pusher不在本地主机上工作,但在生产环境下工作?,php,laravel,vue.js,Php,Laravel,Vue.js,我正在制作一个小型约会应用程序,使用Pusher和Laravel。我使用一个名为NewMessage的事件,监听频道msg.{userId}。倾听是有效的,但广播活动则不然。但它在生产中起作用 我的代码如下: NewMessage.php public function __construct(Message $message, $toUserId, $conversation) { // $this->message = $message;

我正在制作一个小型约会应用程序,使用Pusher和Laravel。我使用一个名为
NewMessage
的事件,监听频道
msg.{userId}
。倾听是有效的,但广播活动则不然。但它在生产中起作用

我的代码如下:

NewMessage.php

    public function __construct(Message $message, $toUserId, $conversation)
    {
        //
        $this->message = $message;
        $this->toUserId = $toUserId;
        $this->conversation = $conversation;
    }
    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('msg.'.$this->toUserId);
    }
    public function broadcastAs()
    {
        return 'NewMessage';
    }

ConversationController.php

event(new NewMessage($message, $toUserId, $conversation));

在config/broadcasting.php中,我刚刚将
加密的
设置为false,它就工作了

检查生产应用程序的.env文件,并将
BROADCAST\u DRIVER=log
设置为
BROADCAST\u DRIVER=pusher

生产中是否有SSL连接?:)是的,在heroku