@nickywan123 there is something wrong if it is not working so to save you some time use/follow the following steps and it works 100%.
.env
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=localapp
PUSHER_APP_KEY=localapp
PUSHER_APP_SECRET=localapp
PUSHER_APP_CLUSTER=mt1
config/Broadcasting.php
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
'host' => 'trasport-web-app.test',
'port' => 6001,
'scheme' => 'http',
],
],
config/app:providers array uncomment the following
App\Providers\BroadcastServiceProvider::class,
resources/js/bootstrap.js
window.Echo = new Echo({
broadcaster: "pusher",
key: "localapp",
wsHost: "127.0.0.1",
wsPort: 6001,
disableStats: true,
encrypted: false,
forceTLS: false,
});
Now Create and event and start the websocket server then go to dashboard connect your app and fire the event.
et voilà !