我正在按照 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)