Category : pusher

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’ve setup a notification system with Pusher and Echo on my Laravel 8 app. It works fine, I’m able to retrieve the notification event in VanillaJS with window.Echo.private(‘App.Models.User.’ + User.id) .notification((notification) => { if (notification.type === ‘AppNotificationsJobLiked’) { let count = document.getElementById(‘count’); let number = count.innerHTML; number++; count.innerHTML = number; } }); But now I ..

Read more

Laravel 7 I am trying to add Laravel Notification in my project but stuck at listening notifications, mostly getting errors at broadcasting/auth I have solved this issue once but still not getting notification here is my code AppNotificationsMessageReceived class MessageReceived extends Notification { use Queueable; /** * Create a new notification instance. * * @return ..

Read more

my controller look like public function react(Request $request){ //echo "hi"; //return; //return response()->json($request); $this->validate($request, [ ‘postid’ => ‘required’, ‘react’ => ‘required’ ]); $reaction = Reaction::firstOrNew([ ‘post_id’=>$request->postid, ‘user_id’=> Auth::id() ]); $reaction->user_id = Auth::id(); $reaction->type = $request->react; $reactType = ""; if ($request->react === "l"){$reactType = "liked";} else if ($request->react === "d"){$reactType = "disliked";} else if ($request->react === ..

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 am trying to make a Real Time Chat App in laravel using pusher Everything was working fine until I added "Private Event" The error that I am getting is :- auth 403 forbidden error BroadcastChat.php:- <?php namespace AppEvents; use AppModelsChat; use IlluminateBroadcastingChannel; use IlluminateBroadcastingInteractsWithSockets; use IlluminateBroadcastingPresenceChannel; use IlluminateBroadcastingPrivateChannel; use IlluminateContractsBroadcastingShouldBroadcast; use IlluminateContractsBroadcastingShouldBroadcastNow; use IlluminateFoundationEventsDispatchable; ..

Read more

I am a beginner and trying to create a basic private Live chat application in laravel using pusher. when I hit the send button this error appears in my Network:- 403 POST 127.0.1:8000 auth app.js:39925(xhr) And in response it says:- 403 FORBIDDEN Here’s My ContactsList.vue:- mounted() { axios.get(‘/api/contacts-list’) .then(response => this.contacts = response.data) }, methods: ..

Read more

I am integration laravel pusher it is working fine on local host but on live server in queue it is giving this error IlluminateBroadcastingBroadcastException: auth_key should be a valid app key env file BROADCAST_DRIVER=pusher PUSHER_APP_ID=***** PUSHER_APP_KEY=**** PUSHER_APP_SECRET=***** PUSHER_APP_CLUSTER=ap2 broadcating.php ‘pusher’ => [ ‘driver’ => ‘pusher’, ‘key’ => env(‘PUSHER_APP_KEY’), ‘secret’ => env(‘PUSHER_APP_SECRET’), ‘app_id’ => env(‘PUSHER_APP_ID’), ‘options’ ..

Read more

This is how is called my event $post = Post::create([ ‘title’ => $request->title, ‘body’ => $request->body, ‘user_id’ => auth()->id(), ]); event(new PostPublished($post)); Route for this method is Auth::routes(); Route::post(‘posts’, [AppHttpControllersHomeController::class, ‘storePost’])->name(‘posts.store’); And this is how I called broadcastOn() in my event public function broadcastOn() { return new Channel(‘post’); } And in my channels.php Broadcast::channel(‘post’, function ..

Read more