我试图使用Pusher Notificaiton系统使用web套接字更新当前页面,其中包含消息"YOu有一个新通知“和指示未读通知数量的钟图标。我注册了事件和侦听器,并实现了ShouldBroadcase并连接了所有东西。但我没有收到任何信息。,除非页面重新加载,否则我是而不是。也有未读通知。
这是我的密码
事件
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Bro
我刚开始使用,遇到了一个问题。我正在使用Pusher,我想检查用户是否被授权订阅一个私人频道。用户对posts注释通知的访问是经过身份验证的,但没有授权。我试图只向帖子的作者发送新评论的通知,但是所有已打开帖子的认证用户都会收到通知。我是不是漏掉了什么?
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broa
在我的Laravel Framework5.7/Vuejs2.6中,我使用了jwt.auth并安装了pusher
我检查我的页面的xsfr令牌,但我在请求和打开此url的响应中得到了419错误,我看到页面过期消息。
在app/Events/NewMessage.php中:
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illumi
我目前正在学习如何正确使用Laravel echo推进器,但在过去的几天里,我遇到了困难,我无法前进,也无法解决这个问题。
我一直收到419错误
/broadcasting/auth 419 (proxy reauthentication required)
但我看不出问题出在哪里
我在控制器中有一个方法,它在插入消息后触发事件。
/** The headers of the controller class **/
use App\Message;
use App\User;
use Auth;
use App\Events\MessagePosted;
/*The event tha
我不知道我的代码出了什么问题
这是我的app.js
/**
* First we will load all of this project's JavaScript dependencies which
* include Vue and Vue Resource. This gives a great starting point for
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
/**
* Next, w
我将我的应用程序从5.2更新到5.3,使用Pusher广播通知,但是当pusher试图通过broadcasting/auth验证当前登录的用户时,我得到了一个错误:
Pusher : No callbacks on private-App.Models.Client.9 for pusher:subscription_error
在浏览器控制台->network->xhr中,我发现对broadcasting/auth的请求没有给我auth:{token}对象,而是返回我的登录页面!
我认为这是中间件的一个问题,但我找不到它。
BroadcastServiceProvider.php
所以我试着用Laravel Echo连接到一个私人频道。我能够连接到公共信道,但我在验证一个(使用正确的Bearer登录的)私有通道时遇到了问题--从laravel-echo-server start获取以下错误
L A R A V E L E C H O S E R V E R
version 1.6.2
⚠ Starting server in DEV mode...
✔ Running at localhost on port 6001
✔ Channels are ready.
✔ Listening for http events...
✔ Listening fo
Laravel 7 我正在尝试在我的项目中添加Laravel Notification,但仍然停留在侦听通知上,主要是在广播/身份验证时收到错误。我已经解决了这个问题一次,但仍然没有收到通知。这是我的代码 应用\通知\收到的消息 class MessageReceived extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*
*/
public $notification;
public function
我正试着用私人频道鉴定幼虫的回声。每次我得到“不能被验证到私有篮子细节..1”。"basket_details“这是通道名称,1是参数。
当我使用公共频道时,一切都工作得很好。所以我认为auth部分有一些问题。
这是我的错误日志
⚠ [14:42:55] - 5eKrT28nX7uLHEkLAAAG could not be authenticated to private-basket_details.1
{
"message": "",
"exception": "Symfony\Component\HttpK
我正在尝试用laravel实现事件广播和通知。其目标是通过通知向登录用户广播一条私有消息。
我创建了这个事件,请参阅下面的代码:
<?php
namespace App\Events;
use App\Models\User;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use I
我开发了一个laravel 5应用程序,除了偶尔在VerifyCsrfToken.php第53行获得VerifyCsrfToken.php之外,一切都很好。我似乎找不出原因。这主要发生在登录过程中。我使用了laravel内置的特性来实现认证。下面是我的示例注销方法。
public function getLogout()
{
Auth::logout();
Session::forget('cart_id');
Session::forget('is_supervisor');
Sessio
因此,正如我的标题所述,我希望将Laravel的默认Broadcast auth中间件更改为使用基于令牌的身份验证的自定义auth中间件。我之所以这样做,是因为我的应用程序是一个基于API的应用程序,当用户进行身份验证时,我创建一个会话令牌并发送给他,并使用expires_at列将其存储在DB中。我正在使用Pusher。
我有以下中间件:
class AuthCustom
{
public function handle($request, Closure $next)
{
// if we have the session token stored in he
我在试图播报一个没有成功的活动。我找不到问题所在,我没有什么想法。我所犯的错误是。
"Too few arguments to function App\Events\ConversationUpdate::__construct(),
1 passed in /app/Events/ConversationUpdate.php on line 36 and exactly 2 expected"
我试图做的是,当一个消息被创建,广播一个事件到聊天,并更新聊天与新的消息实时。
这是我的代码:
主计长:
public function newConversationMessage
我的通知RealtimeNotification.php有:
public function via($notifiable)
{
return ['broadcast'];
}
public function toBroadcast($notifiable){
return new BroadcastMessage([
'name' => 'John Snow'
]);
}
在我看来,我有一个与我的pusher帐户连接的pusher对象:
var channel = pusher.subscrib