acelords/laravel-users-online

This package will provide an online users management.

Maintainers

👁 SyntaxLexx

Package info

github.com/acelords/laravel-users-online

pkg:composer/acelords/laravel-users-online

Statistics

Installs: 55

Dependents: 0

Suggesters: 0

Stars: 0

3.0.6 2023-02-01 14:31 UTC

Requires

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 0f5cf013cdacfce5989647a5280057b5adabdc86

Userslaravel

This package is auto-updated.

Last update: 2026-06-29 01:54:17 UTC


README

👁 Latest Stable Version
👁 Total Downloads
👁 License

Laravel compatibility

Laravel Package
9.x.x 3.0.x
8.x.x 3.0.x
7.x.x 3.0.x
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

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

Run composer update or php composer.phar update.

Or install directly via composer

composer require acelords/laravel-users-online

After composer command, add the trait in your model User in app/User.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():

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

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

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

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

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

Using with Real-time Facades:

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