Laravel Echo for Nuxt.js 2x (Modified by FlyingSpoon)
This has been tested with "laravel-echo": "^1.11.3"
, please install this
version to avoid any issues with compatibility.
...
buildModules: [
'@/modules/nuxt-echo'
]
...
...
echo: {
broadcaster: 'pusher',
CSRFendpoint: 'http://127.0.0.1:8000/api/sanctum/csrf-cookie',
authEndpoint: 'http://127.0.0.1:8000/api/broadcasting/auth',
wsHost: '127.0.0.1',
wsPort: 6001,
key: 'bDYhf22uk2GvRPIrLxh2nFdhGZFR9zmP',
encrypted: true,
// enableLogging: true,
connectOnLogin: false,
disconnectOnLogout: false,
disableStats: true,
forceTLS: false,
authModule: true
// enabledTransports: ['ws', 'wss'],
// plugins: [ '@/plugins/echo.js' ]
}
...
If you use the broadcaster pusher
, you need to ensure that you have pusher-js
installed:
yarn add pusher-js # or npm install pusher-js
If you use the broadcaster socket.io
, you need to ensure that you have socket.io-client
installed:
yarn add socket.io-client # or npm install socket.io-client
Copyright (c) Nuxt Community