Category : laravel-echo

I am broadcasting a client event to a private channel – Echo.private(`video-call.${user.id}`) .whisper(‘incomingVideoCall’, { fromUser: state.authUser, signalData: data }); But it is trying to broadcast event before it subscribes to the channel. This is my pusher debug console – So, is there any callback that I can attach to Echo.private like – Echo.private(`video-call.${user.id}`).then((echo) => { ..

Read more

I’m currently having a problem getting websockets set up with socket.io from React to Laravel using laravel-echo-server. Everything appears to be working except whenever I navigate to https://api.mysite.com/socket.io/?EIO=4&transport=websocket I’m getting an Internal Server Error. And whenever I check the logs, this is the error: AH01144: No protocol handler was valid for the URL /socket.io/ (scheme ..

Read more

I am working on real time notifications, I am using the following packages: "predis/predis": "^1.1" "laravel-echo": "^1.4.0", "io": "^1.0.0", "socket.io": "^2.1.1", "socket.io-client": "^2.4.0" I also downgraded the socke.io-client version and also added dot "." before event name. But I don’t get any response on my frontend. Can anybody help me out My laravel-echo-server configurations are ..

Read more

I’m currently using laravel-echo-server and websockets (socket.io) to broadcast events to my React application that is on a separate server. As far as it looks, everything set up on the back end and front end are correct. The only issue I’m running into is not being able to connect to websockets (https://api.mysite.com:6001/socket.io/?EIO=4&transport=websocket). I’m getting ERR_CONNECTION_REFUSED. ..

Read more

I am using https://beyondco.de/docs/laravel-websockets, how can I check if other user has seen the message or not. $(‘.channels’).each(function (i) { var channel = $(this).val(); console.log(channel, ‘channel’) window.Echo.private("message." + channel) .listen(‘MessagesEvent’, (e) => { $(‘#chat’).append(e.view) }); window.Echo.join("message." + channel) .joining(user => { $(".status").css(‘background-color’, ‘#00B3FF’) }) .leaving(user => { console.log(user, ‘leaving’); $(".status").css(‘background-color’, ‘grey’) }) }) Sourc..

Read more

I have an app that works using Laravel on the backend, and React on the frontend. We are using beyondcode/laravel-websockets to broadcast websocket messages from the Laravel server to a React client. React is able to get the message using the following code: import Echo from "laravel-echo"; window.Pusher = require("pusher-js"); const options = { broadcaster: ..

Read more

I’ve been trying to receive notifications in real-time, such as in this video: https://www.youtube.com/watch?v=i6Rdkv-DLwk&t=1081s by using Pusher – The app is connected to pusher, I receive the notifications events in real-time with Pusher over the console, but I cannot update the notifications count in real-time, on the frontend(see my picture below the code), the new ..

Read more

I am building a real-time chat application with Laravel and Nuxt (Front-end and Back-end separated) using Pusher and Laravel-Echo, I have configured Laravel with pusher and it works fine and can see my requests in the Pusher debug console, I also want to mention two things first, I handle my authentication using Laravel-JWT and Nuxt-Auth ..

Read more

It’s just not working and doesn’t show any errors. Frontend side: import Echo from ‘laravel-echo’; import axios from ‘axios’; window.Pusher = require(‘pusher-js’); window.Pusher.logToConsole = true; window.Echo = new Echo({ broadcaster: ‘pusher’, key: process.env.MIX_PUSHER_APP_KEY, cluster: process.env.MIX_PUSHER_APP_CLUSTER, }); Pusher.logToConsole = true; window.Echo.private(‘report-generated’) .listen(‘ReportGenerated’, (e) => { console.log(e); handleResponse(e.data); }); In the backend side I create new channel ..

Read more

Iam trying to perform a post request with: async sendMessage({ commit }, data) { window.apiClient.defaults.headers.common[‘X-Socket-Id’] = window.Echo.socketId() var response = await window.apiClient.post(`/messages`, data, { headers: { Authorization: ‘Bearer ‘ + token, ‘Accept’: ‘*’, ‘Content-Type’: ‘*’ }, }) IN my main.js I set up: window.apiClient = axios.create({ baseURL: "http://127.0.0.1:8000/api/", headers: { Accept: ‘application/json’, ‘Content-Type’: ‘application/json’, Authorization: ..

Read more

I am listenig for MessageSentEvent window.Echo.private("chat" + this.chat.id).listen( "MessageSentEvent", e => { var date = new Date().getTime(); this.lastMessageDate = moment().to(date); this.lastMessage = e.message; console.log(e.message.sender.id, this.loggedInUser.id); // if (e.message.sender.id !== this.loggedInUser.id) this.chat.messages.push(e.message); } ); while I am using the toOthers-method in my controller broadcast( new MessageSentEvent(new MessageResource($message), $authUser) )->toOthers(); leading to duplicates for the one who ..

Read more

I try to implement a realtime notifcation for liking and unliking someone`s post. I use vue-toaster for short messages, when someone liked my post. I dont understand , why my listen callback runs multple times and leading to this: also, I shouldn’t see this on my screen, because Iam the user liking someones post. Lets ..

Read more