Get online users in laravel

♀尐吖头ヾ 提交于 2020-01-02 07:49:09

问题


I have one user for login to demo of my script.
I want get how many people online now.
I use laravel 5.2
What am I do?


回答1:


You could keep sessions in a DB and use last_activity column to determine how many users are currently online.

https://laravel.com/docs/5.1/session#introduction




回答2:


There is a laravel plugin to achieve this. here's the link :https://github.com/thomastkim/laravel-online-users




回答3:


you can use the below package in order to get online users or determine if a user is online or not.

https://github.com/shetabit/visitor



来源:https://stackoverflow.com/questions/38811097/get-online-users-in-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!