PHPackages                             tusharthe/online-users-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tusharthe/online-users-laravel

ActiveLaravel[Utility &amp; Helpers](/categories/utility)

tusharthe/online-users-laravel
==============================

Show the users online in your Laravel application

1.0(8y ago)04.3k↓17.6%MITPHP

Since Mar 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/tusharthe/online-users-laravel)[ Packagist](https://packagist.org/packages/tusharthe/online-users-laravel)[ RSS](/packages/tusharthe-online-users-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

online-users-laravel
====================

[](#online-users-laravel)

Show the users online in your Laravel application
-------------------------------------------------

[](#show-the-users-online-in-your-laravel-application)

Instalation
-----------

[](#instalation)

install directly via composer

```
composer require tusharthe/online-users-laravel

```

After composer command, register service prodiver in `app/config/app.php` under providers:

```
    tusharthe\OnlineUsers\OnlineUsersServiceProvider::class,
```

After this, add new middleware in `app/Http/Kernel.php` :

```
  \tusharthe\OnlineUsers\Middleware\UsersOnline::class,
```

After this, add the Library (trait) in your model User in `app/User.php`:

```
class User extends Authenticatable
{
       use \tusharthe\OnlineUsers\Library\OnlineUsers;
...
}
```

After this, add the event in your EventServiceProvider in `app/Providers/EventServiceProvider.php`under `'protected $listen = '` :

NOTE: in laravel 5.5 or above aumatically register event
--------------------------------------------------------

[](#note-in-laravel-55-or-above-aumatically-register-event)

```
        'Illuminate\Auth\Events\Logout' => [
            'tusharthe\OnlineUsers\Listeners\LogoutListener',
        ],
```

Finally run :
-------------

[](#finally-run-)

`php artisan vendor:publish` for add the namespaces &amp; select appropriate Provider `tusharthe\OnlineUsers\OnlineUsersServiceProvider`.

How To Use:
-----------

[](#how-to-use)

To get all Online Users just use the method `allOnline()` Like below:

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

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

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

You Can also able to to set timming of user in `app/config/OnlineUser.php`Default 3 min is set.

Laravel compatibility
---------------------

[](#laravel-compatibility)

```
   5.4 or above

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e7f3d8a008a2b2872b5ac9065f678d04ad121318df23c368201dcb49f4f04a6?d=identicon)[tusharthe](/maintainers/tusharthe)

---

Top Contributors

[![tusharthe](https://avatars.githubusercontent.com/u/20502003?v=4)](https://github.com/tusharthe "tusharthe (22 commits)")

### Embed Badge

![Health badge](/badges/tusharthe-online-users-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/tusharthe-online-users-laravel/health.svg)](https://phpackages.com/packages/tusharthe-online-users-laravel)
```

###  Alternatives

[avstudnitz/scopehint2

Displays a hint when a configuration value is overwritten on a lower scope (website or store view).

1671.5M1](/packages/avstudnitz-scopehint2)[ml/iri

IRI handling for PHP

276.4M6](/packages/ml-iri)[octopush/sms-api

Octopush - Send SMS like a PRO

1796.0k1](/packages/octopush-sms-api)[phpcfdi/cfdi-cleaner

Clean up Mexican CFDI

1334.1k1](/packages/phpcfdi-cfdi-cleaner)[icetalker/filament-picker

A Regular Picker for Filament Form

1052.8k](/packages/icetalker-filament-picker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
