【发布时间】:2017-08-09 21:50:28
【问题描述】:
我无法使推杆工作。我已按照文档进行操作,但我不知道问题出在哪里。控制台返回 null。
public function broadcastOn()
{
return new PrivateChannel('my-channel');
}
这是我的推送器 js。
<script src="https://js.pusher.com/4.0/pusher.min.js"></script>
<script>
(function () {
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
var pusher = new Pusher('6049410e84e42d918b14', { 加密:真 });
var channel = pusher.subscribe('my-channel');
channel.bind('\Dms\Events\NewNotification', addMessage);
function addMessage(data) {
var listItem = $("<li class='list-group-item'></li>");
listItem.html(data.message);
$('#messages').prepend(listItem);
console.log(data.message)
}
})()
以上是我用作测试的所有代码。请任何完成此操作的人提供帮助。 Laravel 5.4 是现在使用的。 下面是错误代码。 enter image description here
【问题讨论】:
标签: php laravel laravel-5.4