PHPackages                             atereshchuk/filament-user-activity - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. atereshchuk/filament-user-activity

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

atereshchuk/filament-user-activity
==================================

Tracks user activity and shows currently active users

1.0.0(2y ago)03MITPHPPHP ^8.1

Since Apr 2Pushed 2y agoCompare

[ Source](https://github.com/AndriiTereshchuk/filament-user-activity)[ Packagist](https://packagist.org/packages/atereshchuk/filament-user-activity)[ Docs](https://github.com/AndriiTereshchuk/filament-user-activity)[ GitHub Sponsors](https://github.com/edwink)[ RSS](/packages/atereshchuk-filament-user-activity/feed)WikiDiscussions main Synced 1mo ago

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

Tracks user activity and shows currently active users
=====================================================

[](#tracks-user-activity-and-shows-currently-active-users)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f8c44615ef2768e5a51fd880d3e0481629f7cd7ff88786091a9f141870b289a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656477696e6b2f66696c616d656e742d757365722d61637469766974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/edwink/filament-user-activity)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a5490f88a64033ab1580b9a2a9c24e3fb37d8c8bbbe0854de0bc9de3668ae97e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656477696e6b2f66696c616d656e742d757365722d61637469766974792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/edwink/filament-user-activity/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/af4972b5df36ef7d6e787437f76c2fbb4193ea181548bfd0334da8b5eac4a288/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656477696e6b2f66696c616d656e742d757365722d61637469766974792f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/edwink/filament-user-activity/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0dc9272f225bfe886dd23baa8dd7bcf9b980ced898502c9657d54d9226a5527b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656477696e6b2f66696c616d656e742d757365722d61637469766974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/edwink/filament-user-activity)

[![Filament Active Users](https://raw.githubusercontent.com/edwink75/filament-user-activity/main/img/Active-Users-Table.png)](https://raw.githubusercontent.com/edwink75/filament-user-activity/main/img/Active-Users-Table.png)

Registers all requests and displays it conveniently to see currently online users, ie. with any requests in the last 15 minutes / 30 minutes / 60 minutes / day / week

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

[](#installation)

You can install the package via composer:

```
composer require edwink/filament-user-activity
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="filament-user-activity-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-user-activity-config"
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="filament-user-activity-views"
```

This is the contents of the published config file:

```
return [
    "table" => [
        "name" => env("FILAMENT_USER_ACTIVITY_TABLE_NAME", "user_activities"),
        "retention-days" => env("FILAMENT_USER_ACTIVITY_RETENTION_DAYS", 60),
        'active-users' => [
            'timeframe-selection' => [
                15 => '15 Minutes',
                30 => '30 Minutes',
                60 => 'One hour',
                120 => '2 Hours',
                1440 => '24 hours',
            ],
        ],
    ]
];
```

Usage
-----

[](#usage)

Add Global Middleware in `app/Http/Kernel.php`

```
    /**
     * The application's global HTTP middleware stack.
     *
     * These middleware are run during every request to your application.
     *
     * @var array
     */
    protected $middleware = [
        ...
        \Edwink\FilamentUserActivity\Http\Middleware\RecordUserActivity::class,
    ];
```

Add trait to User Model `app/Models/User.php` to add relationship `activities`

```
use Edwink\FilamentUserActivity\Traits\UserActivityTrait;
...

class User extends Authenticatable
{
    use UserActivityTrait;
    ...
}
```

Configure your panel to have 2 additional views

```
use Edwink\FilamentUserActivity\FilamentUserActivityPlugin;

...
public function panel(Panel $panel): Panel
{
    return $panel
        ...
        ->plugins([
           FilamentUserActivityPlugin::make()
        ])
        ...
}
...
```

Configure a scheduled task to truncate table depending on your configured days (default 60 days) or run it manually from time to time.

```
php artisan filament-user-activity:truncate-activities-table
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Edwin Krause](https://github.com/edwink75)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.5% 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

775d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/492307aa2fac44dca477dcdb4d0955ad1d387e953ff34e2e858c0b51eea246ca?d=identicon)[ATereshchuk](/maintainers/ATereshchuk)

---

Top Contributors

[![edwink75](https://avatars.githubusercontent.com/u/10741779?v=4)](https://github.com/edwink75 "edwink75 (37 commits)")[![bariskanberkay](https://avatars.githubusercontent.com/u/48731845?v=4)](https://github.com/bariskanberkay "bariskanberkay (9 commits)")[![AndriiTereshchuk](https://avatars.githubusercontent.com/u/112692458?v=4)](https://github.com/AndriiTereshchuk "AndriiTereshchuk (2 commits)")[![Noah-Wilderom](https://avatars.githubusercontent.com/u/61543656?v=4)](https://github.com/Noah-Wilderom "Noah-Wilderom (1 commits)")

---

Tags

laravelfilament-user-activity

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/atereshchuk-filament-user-activity/health.svg)

```
[![Health](https://phpackages.com/badges/atereshchuk-filament-user-activity/health.svg)](https://phpackages.com/packages/atereshchuk-filament-user-activity)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[spatie/laravel-slack-alerts

Send a message to Slack

3212.6M4](/packages/spatie-laravel-slack-alerts)[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

142347.8k](/packages/keepsuit-laravel-opentelemetry)[tapp/filament-maillog

Filament plugin to view outgoing mail

2952.6k1](/packages/tapp-filament-maillog)[spatie/laravel-error-share

Share your Laravel errors to Flare

43965.6k3](/packages/spatie-laravel-error-share)[dotswan/filament-laravel-pulse

82137.2k1](/packages/dotswan-filament-laravel-pulse)

PHPackages © 2026

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