F
Filament2y ago
Hugo

Get count of current online users

Hi, I'm trying to create a stats widget that shows me the number of users currently connected to the filament platform. Do you have any idea how to do this? Thanks for your help !
No description
6 Replies
toeknee
toeknee2y ago
You can't out of the box for just filament. You would need to have a table to store the users sessions, then it's if you are having filament users and other users? If filament users, then on login I would say you need to store them in a sessions table and make a job to clean them out after X time of inactivity
Hugo
HugoOP2y ago
I just have users for filament, but ok I see what you mean, thanks.
toeknee
toeknee2y ago
You would want to put a polling livewire component on the admin panel to update the activity of the session. Or on requests
Hugo
HugoOP2y ago
I'll try to do that on the requests, otherwise I'll find a solution 🙂
toeknee
toeknee2y ago
No problem, Jetstream has a sessions table and you could look at how that was implemented
Hugo
HugoOP2y ago
I'll check it out, thanks !

Did you find this page helpful?