-
Notifications
You must be signed in to change notification settings - Fork 311
Closed
Description
Whenever I try to dispatch an event I get this error
<warning>PHP Warning: array_merge(): Expected parameter 2 to be an array, null given in /home/carlomigueldy/playground/laravel-chat-app/api/vendor/pusher/pusher-php-server/src/Pusher.php on line 518</warning>
Can anyone help me out?
This is my MessageSent() class code
<?php
namespace App\Events;
use App\Models\ChatMessage;
use App\Models\User;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class MessageSent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $message;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($message = 'No message')
{
$this->message = $message;
}
public function broadcastAs () {
return 'message-sent';
}
// public function broadcastQueue () {
// return 'broadcastable';
// }
public function broadcastWith () {
return [
'text' => 'Awesome'
];
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new Channel('chat');
}
}
Jusdon and swportSneh-ByteFum
Metadata
Metadata
Assignees
Labels
No labels