PHPackages                             muhammadaftabb/laravel-realtime-user-status - 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. muhammadaftabb/laravel-realtime-user-status

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

muhammadaftabb/laravel-realtime-user-status
===========================================

A Laravel package for real-time user online status

v1.0.0(1y ago)012PHPPHP ^8.0

Since May 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MuhammadAftabB/laravel-realtime-user-status)[ Packagist](https://packagist.org/packages/muhammadaftabb/laravel-realtime-user-status)[ RSS](/packages/muhammadaftabb-laravel-realtime-user-status/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel Real-Time User Status
=============================

[](#laravel-real-time-user-status)

A Laravel package for tracking and displaying real-time user online status.

Installation
------------

[](#installation)

1. **Require the package via Composer:**```
    composer require muhammadaftabb/laravel-realtime-user-status
    ```

Publish the package assets and configuration:

bash Copy code php artisan vendor:publish --provider="MuhammadAftab\\RealTimeUserStatus\\RealTimeUserStatusServiceProvider" --tag=realtime-user-status Run the migrations:

bash Copy code php artisan migrate Configure Pusher: Add your Pusher credentials to your .env file:

env Copy code PUSHER\_APP\_ID=your-pusher-app-id PUSHER\_APP\_KEY=your-pusher-app-key PUSHER\_APP\_SECRET=your-pusher-app-secret PUSHER\_APP\_CLUSTER=your-pusher-app-cluster Include the JavaScript file in your layout: Add the following script tag to your main layout file (e.g., resources/views/layouts/app.blade.php):

html Copy code

&lt;script src="{{ asset('vendor/realtime-user-status/js/realtime-user-status.js') }}" defer&gt;&lt;/script&gt; Add Middleware: Include the middleware in the web middleware group in app/Http/Kernel.php:

php Copy code protected $middlewareGroups = \[ 'web' =&gt; \[ // other middleware... \\MuhammadAftab\\RealTimeUserStatus\\Http\\Middleware\\UpdateUserStatus::class, \\MuhammadAftab\\RealTimeUserStatus\\Http\\Middleware\\LogUserActivity::class, \], \]; Usage Use the helper functions in your Blade views to display online users and their last activity.

Display Online Users blade Copy code

Online Users
============

[](#online-users)

@foreach(\\MuhammadAftab\\RealTimeUserStatus\\Helpers\\RealTimeUserStatusHelper::getOnlineUsers() as $user)  {{ $user-&gt;name }} - @if($user-&gt;is_online) {{ config('realtime-user-status.online_status.online') }} @else {{ str_replace(':time', $user-&gt;last_activity-&gt;diffForHumans(), config('realtime-user-status.online_status.offline')) }} @endif

@endforeach Display User Activity Log blade Copy code User Activity Log
=================

[](#user-activity-log)

@foreach(\\MuhammadAftab\\RealTimeUserStatus\\Helpers\\RealTimeUserStatusHelper::getUserActivityLogs() as $log)  {{ $log-&gt;created_at-&gt;diffForHumans() }} - {{ $log-&gt;user-&gt;name }}: {{ $log-&gt;activity }}

@endforeach Configuration The package configuration file is located at config/realtime-user-status.php. You can customize the online and offline status messages there. php Copy code return \[ 'pusher' =&gt; \[ 'app\_id' =&gt; env('PUSHER\_APP\_ID'), 'app\_key' =&gt; env('PUSHER\_APP\_KEY'), 'app\_secret' =&gt; env('PUSHER\_APP\_SECRET'), 'app\_cluster' =&gt; env('PUSHER\_APP\_CLUSTER'), \], 'online\_status' =&gt; \[ 'online' =&gt; 'Online', 'offline' =&gt; 'Last seen :time ago' \] \]; License This package is open-sourced software licensed under the MIT license.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

712d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58737b3d533b504a382d4cc5dea2d23839fd122ec4c109588a0c107b2d9a2946?d=identicon)[MuhammadAftabB](/maintainers/MuhammadAftabB)

---

Top Contributors

[![MuhammadAftabB](https://avatars.githubusercontent.com/u/89566665?v=4)](https://github.com/MuhammadAftabB "MuhammadAftabB (2 commits)")

### Embed Badge

![Health badge](/badges/muhammadaftabb-laravel-realtime-user-status/health.svg)

```
[![Health](https://phpackages.com/badges/muhammadaftabb-laravel-realtime-user-status/health.svg)](https://phpackages.com/packages/muhammadaftabb-laravel-realtime-user-status)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)

PHPackages © 2026

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