Closed adiraka closed 2 years ago
Perhaps you can show the code you are using which is triggering this error. Although the error is clear, I suspect you are passing a string as the 4th argument to the trigger method. It is expecting an array. 👍
Perhaps you can show the code you are using which is triggering this error. Although the error is clear, I suspect you are passing a string as the 4th argument to the trigger method. It is expecting an array. 👍
im using broadcast
`<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Broadcasting\PresenceChannel; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels;
use App\Message;
class SendPrivateMessage implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels;
public $message;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(Message $message)
{
$this->message = $message;
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new PrivateChannel('messages.'.$this->message->user_to_id);
}
public function broadcastAs()
{
return 'send-private-message';
}
}`
This could be related to the version of Laravel you are using although im not sure. Perhaps update to Laravel 8 or 9 and see if it resolves it. Laravel 7 is also no longer supported for security or bugfixes so it would be good to do that anyway.
i think thats not the solution, it will need more effort to upgrade version of laravel,
@andrew-bibby is correct, you will need to either upgrade Laravel to v 8.29 or downgrade the pusher-http-php package to version 4.1. This will resolve the error being encountered here.
any solution for this? im using "pusher/pusher-php-server": "^7.0", on "laravel/framework": "^7.29",