PHP Pusher 中 array_merge 的错误第二个参数为空

PHP Error with array_merge in Pusher Second param is null

我正在尝试在 Laravel 中发送推送通知。我正在使用推送器,但出现错误。

route.web

Route::get('push', function () {
    event(new App\Events\MessageToProveedor("Welcome"));
    return "Event has been sent!";
})->name('push');

MessageToProveedor 的文件

public $username;

public $message;
/**
 * Create a new event instance.
 *
 * @return void
 */
public function __construct($username)
{
    $this->username = $username;
    $this->message  = "liked your status";
}

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

当我执行 de route /push return Pusher.php 插件时出错。

ErrorException array_merge(): Argument #2 is not an array

失败行 $all_params = array_merge($post_params,$params);

$params 为空

您使用的是 Laravel v8.29.0 吗?这应该在该版本中得到解决。