Have you seen this ? https://github.com/kodeine/laravel-acl
How To Send Notifications To A Specific User Group / Role Only using Socket.io?
Hello!
I am working on a project which I want to implement a feature where after an action happens, I want to notify all online administrators on the web app and show them a message that an action happened. Only the users with the role of admin can see these notifications
I have a few questions:
-
How can I identify which user is online and has an admin role? I am looking for some ideas around "show all online users" list
-
Should I put these admins into a room where I can broadcast the notification only to that room?
-
How can I get all users who are online and associate their socket ID with the ID / Username in the database?
I will also need the online status to be shown in a table so I can know if UserOne and John are online at the moment.
- How can I keep track of the online / offline status? Do I have to keep the status somewhere outside of the database? I am using Laravel 5.1, NodeJS 5.0, Socket.io version 1.3 and Redis to play around with the notifications.
Does anyone have any idea how can I deal with this problem? I am not really looking for any code specific stuff, I am just curious about the theory behind the idea and how it will work.
Thanks!
Please or to participate in this conversation.