Category : broadcasting

In a chat application, Laravel 7.x, Vuejs 2, Flutter 2.8 and Pusher Pacakges I use pusherjs, Laravel echo, pusher-php-server and Flutter pusher_client. in Laravel & Vue public and private channels work fine, in with Flutter public channel also working but, subscribing to private channel show the following error. Cannot subscribe to a private or presence ..

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

I’m working on Laravel + Livewire project (not using any front – end framework) and I need to broadcast notifications to specific user. My channel in channels.php: Broadcast::channel(‘App.Models.User.{id}’, function ($user, $id) { return (int) $user->id === (int) $id; }); Listener in app.js: Echo.private(‘App.Models.User.1′) .notification((notification) => { console.log(notification) }); The thing is I’m successfully receiving notifications ..

Read more

I’m trying to broadcasting to presence channel. But auth seems to not send a member data. Versions composer.json "laravel/framework": "6.20.22", "laravel/passport": "9.0", "predis/predis": "1.1.7", package.json laravel-echo-server: 1.6.2 "socket.io-client": "2.4.0", "laravel-echo": "1.10.0", Server side .env BROADCAST_DRIVER=redis QUEUE_CONNECTION=sync REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 REDIS_PREFIX= laravel-echo-server.json { "authHost": "http://localhost:8080", "authEndpoint": "/custom/broadcasting/auth", "clients": [], "database": "redis", "databaseConfig": { "redis": {}, "sqlite": ..

Read more

I don’t understand where it is blocking, if I replace the update with create it works or if I remove the broadcast the update works how to update with the braodcast ?? thank you call to a member function load() on bool public function SendToMarket(Request $request, $id){ $card = auth()->user()->cards()->findOrFail($id)->update([ ‘market_id’ => $request["_market"], ‘borderStyle_id’ => ..

Read more

I am building a Microservice with Laravel Lumen. The Service should broadcast Events to the pusher socket server when an new Data is inserted in the DB. I installed https://packagist.org/packages/pusher/pusher-php-server and also made an account on pusher and created an application. I configured everything in the lumen app, but nothing gets broadcasted. can someone help ..

Read more

I try to use toOhers() method in broadcasting. In documentation write for this need socketId and I use this in bootstrap.js import Echo from ‘laravel-echo’; window.Pusher = require(‘pusher-js’); let socketId = Echo.socketId(); window.Echo = new Echo({ headers: { ‘X-Socket-ID’ : socketId, }, broadcaster: ‘pusher’, key: process.env.MIX_PUSHER_APP_KEY, cluster: process.env.MIX_PUSHER_APP_CLUSTER, forceTLS: false, }); and blade file <script ..

Read more

I am failing to fetch and display messages from pusher. There are no errors to be seen. I am using Laravel-8 Here’s what is being sent to pusher:- { "message": { "user_id": 17, "message": "naartu", "to": "1", "updated_at": "2020-10-23T09:05:19.000000Z", "created_at": "2020-10-23T09:05:19.000000Z", "id": 32 } } Here’s the code to fetch and display the message:- ounted(){ ..

Read more

I hope this is not a duplicate. I have the following code. I use Laravel’s Echo for Pusher Channels amid Laravel Broadcaster. Echo.private(‘UserChannel.’+user.id+’.notifications’) .listen(‘.new-notification’, (data)=>{ this.notifs.push(data); }); Is there a clean way to run a callback function after Laravel’s Echo library has successfully authenticated the private channel with the origin server? I couldn’t find something ..

Read more