Category : pusher

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 have followed the steps mentioned in this link for desktop notification in localhost https://pusher.com/tutorials/desktop-notifications-laravel/. and run the command in cli ‘npm run dev’. after running the project using command ‘php artisan serve’ in live link getting the error app.js require(‘./bootstrap’); Vue.component(‘home’, require(‘./components/Home.vue’)); webpack.mix.js const mix = require(‘laravel-mix’); /* |————————————————————————– | Mix Asset Management |————————————————————————– ..

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

My controller: This is the method from where events will be triggered. public function fireUserNotification() { $payload = [ ‘app’ => ‘AppName’, ‘action’ => ‘supportActionReply’, ‘payload’ => [ ‘message’ => ‘this is a message’, ‘foo’ => ‘bar’, ‘user_uuid’ => auth()->user()->user_uuid ] ]; event(new AppEventsUserNotifyUser($payload)); return response()->json([‘message’ => ‘fired’],200) } My Events:(This is the events which ..

Read more

My controller: This is the method from where events will be triggered. public function fireUserNotification() { $payload = [ ‘app’ => ‘AppName’, ‘action’ => ‘supportActionReply’, ‘payload’ => [ ‘message’ => ‘this is a message’, ‘foo’ => ‘bar’, ‘user_uuid’ => auth()->user()->user_uuid ] ]; event(new AppEventsUserNotifyUser($payload)); return response()->json([‘message’ => ‘fired’],200) } My Events:(This is the events which ..

Read more

My controller: This is the method from where events will be triggered. public function fireUserNotification() { $payload = [ ‘app’ => ‘AppName’, ‘action’ => ‘supportActionReply’, ‘payload’ => [ ‘message’ => ‘this is a message’, ‘foo’ => ‘bar’, ‘user_uuid’ => auth()->user()->user_uuid ] ]; event(new AppEventsUserNotifyUser($payload)); echo "done"; exit(); } My Events:(This is the events which was ..

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

Following is the code of JavaScript: import Echo from ‘laravel-echo’; window.Pusher = require(‘pusher-js’); window.listener = new Echo({ authEndpoint: window.siteRootPath + ‘broadcasting/auth’, broadcaster: ‘pusher’, key: window.PUSHER_APP_KEY, cluster: window.PUSHER_APP_CLUSTER, forceTLS: false, auth: { headers: { Authorization: ‘Bearer ‘ + window.csrfToken } } }); window.listener.private(‘bookings’) .listen(‘booking-new’, function(e) { console.log(e.booking); }); All variables (siteRootPath, PUSHER_APP_KEY, PUSHER_APP_CLUSTER and csrfToken) have ..

Read more

Is there a way we can check if user is trying to connect to a channel in different tab or browser in which he is already connected in laravel websockets window.Echo.join("homework.1341") .here(Husers => { console.log(Husers) }) .joining(user => { console.log(user, ‘user1’) }) .leaving(user => { console.log(user) }).error((error) => { console.error(error); }) .notification((notification) => { console.log(notification.type); ..

Read more

What I am trying to do is the following Get a list of user_count for ALL PRESENCE channels. Using the following HTTP API call https://pusher.com/docs/channels/library_auth_reference/rest-api/#get-channels-fetch-info-for-multiple-channels I am not sure if its me, or if their documentation is complicating or what the issue is but what I cannot figure out is how to build the GET ..

Read more

I am working on developing a chat application in laravel the user’s table Schema::create(‘users’, function (Blueprint $table) { $table->id(); $table->string(‘name’); $table->string(’email’)->unique(); $table->enum(‘status’,[‘active’,’busy’,’Do Not Disturb’]); $table->timestamp(’email_verified_at’)->nullable(); $table->string(‘image’)->default(‘user0.jpg’); $table->string(‘password’); $table->rememberToken(); $table->timestamps(); }); Each user has friends and they are connected by many to many relation like this $user = User::with(array(‘friends.rooms’ => function($query) use ($roomArray){ $query->whereIn(‘rooms.id’,$roomArray); },’friends.rooms.messages’ => ..

Read more

currently I’m intalling dependences in one pryect that I cloned yesterday, and I’m having this problem: Installing dependencies from lock file (including require-dev) Verifying lock file contents can be installed on current platform. Your lock file does not contain a compatible set of packages. Please run composer update. Problem 1 – pusher/pusher-php-server is locked to ..

Read more