百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

laravel-users-online

> 编程语言
开源

在 Laravel 应用中显示在线用户

197 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

在 Laravel 应用中显示在线用户

Laravel Users Online

Laravel compatibility

Laravel Package
6.x.x 3.0.x
5.8.x 3.0.x
5.7.x 2.3.x
5.6.x 2.3.x
5.5.x 2.3.x
5.4.x 2.2.x
5.3.x 2.0.x
5.2.x 1.0.x

Installation

Add the new required package in your composer.json

"highideas/laravel-users-online": "^3.0"

Run composer update or php composer.phar update.

Or install directly via composer

composer require highideas/laravel-users-online

After composer command, add the trait in your model User in app/User.php:

php

class User extends Authenticatable
{
    use \HighIdeas\UsersOnline\Traits\UsersOnlineTrait;
...

Finally run php artisan vendor:publish for add the namespaces

Usage

For show the users online just use the method allOnline():

php
$user = new User;
$user->allOnline();

Or if you want to check if a specific user is online use the method isOnline():

php
$user = User::find($id);
$user->isOnline();

You can sort all users online with the methods mostRecentOnline() and leastRecentOnline():

php
$user = new User;
$user->mostRecentOnline();
$user->leastRecentOnline();

Using with Real-time Facades:

php
use Facades\App\User as UserFacade;

UserFacade::mostRecentOnline();
UserFacade::leastRecentOnline();

Installation and usage on last versions of framework:

Laravel 5.5 - 5.7

Laravel 5.4

Laravel 5.3

Laravel 5.2

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言