Before I posted this question, I checked other SO/articles with the same problem but did not really fixed anything. My freshly installed Laravel 8 application is not registering the events in dashboard though I can see the events if in Laravel.log file. This is the tutorial that I was following. In .env file, if I change the BROADCAST_DRIVER value to log, I can see in the log file the following:
local.INFO: Broadcasting [chatapplication] on channels [public.chatapplication.1] with payload:
{
"test": 123,
"data": "send data",
"socket": null
}
Below is the code that I tried to follow in the tutorial:
.env
BROADCAST_DRIVER=log # or pusher
QUEUE_CONNECTION=sync
# App\Events\ChatApplication
class ChatApplication implements ShouldBroadcast
{
public function broadcastOn()
{
// return new PrivateChannel('channel-name');
$info = new Channel('public.chatapplication.1');
Log::info($info);
return $info;
}
public function broadcastAs()
{
return "chatapplication";
}
.....
}
#config/broadcasting.php
'connections' => [
....
'pusher' => [
....
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => false,
'encrypted' => false,
'host' => '127.0.0.1',
'port' => 6001,
'scheme' => 'http'
],
],
....
];
I am trying to trigger the events in both php artisan tinker and in route and still nothing.
#web.php
Route::get('/chat-application', function () {
event(new \App\Events\ChatApplication("send data"));
});
The same event(new \App\Events\ChatApplication("send data"))
in tinker . returned empty array.
The expected output should be events is displayed in dashboard. I read about queues and other things on other post but I dont really now where I should change. I am running in windows with wamp server