I just tried laravel reverb, and I noticed that everytime I make some changes in the code, I can’t connect to the websocket.
Console Error/Warning
I returned the code back to where I started, but I still can’t connect to the websocket. Please do take note that this was working flawlessly when I started.
I checked on the laravel documentation, it said to use this command
php artisan reverb:restart
To reflect the changes. but this doesn’t seem working out for me.
Anybody here can help?
-
I added new public channel:
Broadcast::channel('ewpChanges', function () { return true; });
-
Then created an event:
`class ewpChangesEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;/**
- Create a new event instance.
*/
public function __construct(public array $data)
{
//
}
/**
- Get the channels the event should broadcast on.
- @return array<int, IlluminateBroadcastingChannel>
*/
public function broadcastOn(): array
{
return [
new Channel(‘ewpChanges’),
];
}
}`
- Create a new event instance.
Then suddenly I can’t connect to the websocket
Franclloyd Dagdag is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.