简体   繁体   English

在laravel中获取在线用户

[英]Get online users in laravel

I have one user for login to demo of my script. 我有一个用户可以登录以演示我的脚本。
I want get how many people online now. 我想现在有多少人在线。
I use laravel 5.2 我使用laravel 5.2
What am I do? 我怎么办

There is a laravel plugin to achieve this. 有一个laravel插件可以实现这一目标。 here's the link : https://github.com/thomastkim/laravel-online-users 这是链接: https : //github.com/thomastkim/laravel-online-users

You could keep sessions in a DB and use last_activity column to determine how many users are currently online. 您可以将会话保留在数据库中,并使用last_activity列来确定当前有多少用户在线。

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

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://github.com/shetabit/visitor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM