小编cka*_*sai的帖子

Laravel Pusher array_merge:预期参数 2 是一个数组,给定 null

我正在按照 pusher 的教程在网站上显示通知。一切都与教程一致,但是当我尝试访问通知时出现了这个特定的错误,localhost:8000/test我不知道如何修复它。

错误信息

预期结果:通知发送消息

输出:array_merge() 错误

相关教程:https : //pusher.com/tutorials/web-notifications-laravel-pusher-channels

相关文件:C:\xampp\htdocs\inventory-prototype\vendor\pusher\pusher-php-server\src\Pusher.php:518

这是我的Events/ItemAdd

class ItemAdd implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public $user;
    public $message;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct($user)
    {
        $this->user = $user;
        $this->message = '{ $user } added an item';
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return ['item-add'];
    } …
Run Code Online (Sandbox Code Playgroud)

php websocket laravel pusher

2
推荐指数
2
解决办法
2098
查看次数

标签 统计

laravel ×1

php ×1

pusher ×1

websocket ×1