Notification persistence across pages with Laravel, Redis & Socket.io - laravel-5

I am working on Laravel 5.3 , Redis and Socket.io. I am able to successfully get the notification on client side with Laravel broadcasting.
But when a page is refreshed, all notifications are lost.
Is there a way to persist these notification across various pages ?

Related

Should a chat app running on Vue and Laravel use a Laravel queue?

Should a chat app running on Vue and Laravel use a Laravel queue? In Laravel, there is a QUEUE_CONNECTION=sync, should that be used? Or, should some kind of queuing be used instead for a chat app? Any help would be greatly appreciated.

How to broadcast real time events to external application

I'm working on a project where Laravel is the back-end and front-end is a ReactJS. I'm responsible for back-end only and we are building back-end as a restful api, so I'm using sanctum to authenticate user, there are no sessions, stateless flow. Now I need to implement a real time in web notifications. I was thinking about using Laravel Broadcasting: Redis + Laravel echo server. But the problem is, that frontend is not made on laravel. Its a simple ReactJS SPA, that uses back-end as an API.
My question is what is the best way to implement this functionality? I guess listening to standard events from that ReactJS app is not going to work?

REST API sending webhooks to front end

If my rest API has a webhook setup where it is getting information, how do I notify the front end that new information is received and is ready to be sent? Can the API only send data to front end if the front end requests it? Using Spring boot and Vuejs.
Well, I've never used Vue.js or Spring boot, but I'm familiar with React and since both are front-end libraries I believe they work similarly. I believe what you're looking for is Socket.io which will create a real-time, bidirectional and event-based communication between the client's browser and the server. So when you receive an event in your webhook you communicate whatever you want to the client.
Here is an example on how to build it using vue.js and Node.js, I'm sure you can tailor it to your needs.
https://medium.com/js-dojo/build-a-real-time-chat-app-with-vuejs-socket-io-and-nodejs-714c8eefa54e

Sending web push notifications from Laravel

I have a website running Laravel in the back-end, where users can create reports for other users.
When the report is created I would like to send a push notification to recipient user's desktop.
Do I need to use services like Pusher, OneSignal?
Any useful site with examples would be appreciated.
Your question
You could use Pusher, Redis/Socket.io, Pubnub, etc. Which one to use? well, this is more an opinion-based question.
These services broadcast events, then in your client apps (like your web front-end) you configure the client-side libraries of the service you choose to subscribe (to channels) and listen to those events. The documentation explains it better.
Examples/tutorials
Pusher
This is a tutorial published by the Pusher team.
Redis/Socket.io
This one
is a Laracasts series about this.
Just google.
Update
There is a Laravel-specific alternative, a package created exclusively for Laravel:
Laravel WebSockets
This is the post talking about the package and its inner working.
This is the repo.
Here you have the documentation.
If you like to show Native Desktop notification then i would suggest Web Push notification. In this way once user subscribed to push notification ,they will get real time notification and does not need to be on your website.
https://github.com/laravel-notification-channels/webpush

Membership Site: Laravel 5 & Infusionsoft & Push Notifications

I'm building a membership site for a client who uses the Infusionsoft CRM for product (course) subscriptions and payments.
They're currently running the membership site on Wordpress with the Memberium plugin handling the Infusionsoft integration, but they're moving away from Wordpress.
The Infusionsoft-related functionality I'm looking for:
Users sign-up / opt-in via Infusionsoft forms (this is a given)
Credentials get
saved into Infusionsoft (the form handles this)
Users log into the
app with their Infusionsoft credentials
Two-way sync between the app & Infusionsoft (changes to profile / subscriptions / payment info made by the user in the app get saved into Infusionsoft)
Permission levels: Users have limited access to pages after log-in, based on the products they subscribed for (products are in Infusionsoft). i.e.: a user subscribed to the cheapest plan will see content associated with that products, and will have 3 entries in the main nav; but a user who subscribed to the most expensive package will see all the content and will have 5 entries in the main nav. There are 3 membership levels in total.
The memberium plugin handles these (and much more) easily, but I need to have the same functionality outside of Wordpress.
It shouldn't be hard to pull off, as the official Infusionsoft PHP client Library has support for Laravel and there are multiple versions of Laravel 5 Ports of the Infusionsoft PHP SDK on Packalyst.
The non-infusionsoft functionality I'm looking for:
Forum: a proper forum with the ability for logged in users to start threads, comment, etc
Event calendar containing upcoming events, scheduled video releases,etc.
Ability for admins to upload videos, edit content, publish blog post.
Push notifications Android & iOS app versions (packaged Chrome, have the Android & iOS API keys to use for the notifications)
The client is expanding from the UK and going global. I'm thinking of using MongoDB.
So my questions are:
Should I use MongoDB or should I stay away and go with classic MySQL?
Does MongoDB have potential issues with Infusionsoft or Laravel 5?
OctoberCMS vs Laravel Backpack? Both handle the blog posts, the content uploads & the calendar out of the box.
Are there any known issues with Infusionsoft integration & OctoberCMS running a modified Laravel?
Push Notifications? Should Infusionsoft handle these or the app itself?
Suggestions for packages? I saw quite a few things on Packalyst for everything.
I haven't used Laravel since 4.2 and I've never done anything with Infusionsoft.
I did some reseach but the results were mixed in terms of Infusionsoft integration and most of the results were for older Laravel versions or the older version of the Infusionsoft API.
Sorry for the TLDR post, it's my 1st question on StackOverflow :)
Any insight to Infusionsoft integration & Laravel 5, or suggestions for packages to use would be welcome :)
Particularly for the forum & the push notifications (in case those are not handled via Infusionsoft).

Resources