PHPackages                             djl997/laravel-actor-is-active - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. djl997/laravel-actor-is-active

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

djl997/laravel-actor-is-active
==============================

A package to set online status to an actor model (the User in most cases).

0.2.0(8mo ago)0188MITPHPPHP ^8.2

Since Sep 4Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/djl997/laravel-actor-is-active)[ Packagist](https://packagist.org/packages/djl997/laravel-actor-is-active)[ RSS](/packages/djl997-laravel-actor-is-active/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Laravel Actor is Online
=======================

[](#laravel-actor-is-online)

[![Latest Version on Packagist](https://camo.githubusercontent.com/293c17b18c361cc2bfc77eca99fcfef34c44a8db82037c782d22e17f159010fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646a6c3939372f6c61726176656c2d6163746f722d69732d6163746976652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/djl997/laravel-actor-is-active)[![Total Downloads](https://camo.githubusercontent.com/4a16998f79106e3e9595607cad772f0bf7e65a6256dc53ffc4d2e3bfa496cf48/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646a6c3939372f6c61726176656c2d6163746f722d69732d6163746976652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/djl997/laravel-actor-is-active)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

This package provides a simple and easy way to check if an *Actor* in your application is active or was active recently. In most cases *Actor* will be your app user, but in some cases it can be some logic like a bot, variable Cronjob, Queue or another external proces you want to monitor.

The package doesn't require any database migrations because it's built on the [Laravel Cache Driver](https://laravel.com/docs/cache).

Requirements
------------

[](#requirements)

Laravel Actor is Online requires PHP 8.2 or higher and Laravel 11+.

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

[](#installation)

1. You can install the package via composer:

    ```
    composer require djl997/laravel-actor-is-active
    ```
2. Prepare your actor model:

    ```
    namespace App\Models;

    use Djl997\LaravelActorIsActive\Traits\IsOnlineTrait;

    class Actor {

        use IsOnlineTrait;

        // ..

    }
    ```
3. Set online status

    - [Route Middleware (recommended for Auth)](#route-middleware-recommended-for-authenticables)
    - [Manually](#manually)

### Route Middleware (recommended for Authenticables)

[](#route-middleware-recommended-for-authenticables)

Activate the middleware to automatically update the online status of Users in your application, add the following to your `app/Http/Kernel.php` file:

```
protected $middlewareGroups = [
    'web' => [
        // ..
        \Djl997\LaravelActorIsActive\Http\Middleware\IsOnline::class,
    ]
];
```

### Manually

[](#manually)

If you want to update the status manually or if middleware is not applicable in your case:

```
$model = Model::find(1);

$model->touchOnline();
```

Advanced Usage
--------------

[](#advanced-usage)

```
$user = User::find(1);

$user->isOnline(); // returns true if user is online
$user->wasOnlineRecently(); // returns true if user was inline x minutes ago (by default 5-30 minutes, customizable via config)
$user->lastOnlineAt(); // returns Carbon object of last online timestamp
$user->getCacheActorOnlineKey(); // get the online cache key
```

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

[](#contributing)

Contributions are welcome.

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance58

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~179 days

Total

5

Last Release

266d ago

PHP version history (2 changes)0.1.0PHP ^8.0

0.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/61d06c885745a581b7313ca440075d14611fa5dc7840e43031d2fd2a056a50e4?d=identicon)[djl997](/maintainers/djl997)

---

Top Contributors

[![djl997](https://avatars.githubusercontent.com/u/27086857?v=4)](https://github.com/djl997 "djl997 (12 commits)")

### Embed Badge

![Health badge](/badges/djl997-laravel-actor-is-active/health.svg)

```
[![Health](https://phpackages.com/badges/djl997-laravel-actor-is-active/health.svg)](https://phpackages.com/packages/djl997-laravel-actor-is-active)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)[corbosman/laravel-passport-claims

Add claims to Laravel Passport JWT Tokens

88655.9k](/packages/corbosman-laravel-passport-claims)

PHPackages © 2026

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