为什么我在 Laravel V8 中使用 Pusher V6 时会看到错误

问题描述 投票:0回答:1

我正在使用 Pusher 版本 6 和 Laravel 版本 8。问题是当我尝试广播时,我看到以下错误。 据我检查,这个错误在较低版本的 Pusher 中不会发生

类型错误 array_merge():参数 #2 必须是数组类型,给定 null

我的代码:

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

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public $order;

    public function __construct($order)
    {
        //
        $this->order = $order;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new Channel('my-channel');
    }
}

如果您找到任何解决方案,请告诉我。

php laravel-8 pusher
1个回答
0
投票

您应该将 Laravel 版本升级到 v8.29.2,或者将 Pusher 版本降级到 4.1

来源: Laravel Pusher array_merge:期望参数 2 是一个数组,给定 null https://github.com/pusher/pusher-http-php/issues/288

© www.soinside.com 2019 - 2024. All rights reserved.