PHPackages                             l0max/laravel-activity-log - 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. l0max/laravel-activity-log

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

l0max/laravel-activity-log
==========================

A Laravel package to log and store user activities across the application

v1.0.0(1y ago)01MITPHPPHP ^7.1.3|7.2.\*|7.3.\*|7.4.\*|8.\*

Since Jan 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/L0MAX/laravel-activity-log)[ Packagist](https://packagist.org/packages/l0max/laravel-activity-log)[ Docs](https://github.com/l0max/laravel-activity-log)[ RSS](/packages/l0max-laravel-activity-log/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Activity Log
====================

[](#laravel-activity-log)

[![Latest Stable Version](https://camo.githubusercontent.com/69c3d3ca123a1bbfdfae95efd1cbf042d27298043b6d813cc6b615b43cbc1590/68747470733a2f2f706f7365722e707567782e6f72672f6c306d61782f6c61726176656c2d61637469766974792d6c6f672f762f737461626c65)](https://packagist.org/packages/l0max/laravel-activity-log)[![Total Downloads](https://camo.githubusercontent.com/1c4c3a14a197645e94c8cf7a5df123c2c184b85d4c54bbff9a7b8c0081dfa1d7/68747470733a2f2f706f7365722e707567782e6f72672f6c306d61782f6c61726176656c2d61637469766974792d6c6f672f646f776e6c6f616473)](https://packagist.org/packages/l0max/laravel-activity-log)[![License](https://camo.githubusercontent.com/c02a33b7442330e44a3859ce195097835212c9551d41bbbcc8e77a3d0cb3ad0d/68747470733a2f2f706f7365722e707567782e6f72672f6c306d61782f6c61726176656c2d61637469766974792d6c6f672f6c6963656e7365)](https://packagist.org/packages/l0max/laravel-activity-log)

A simple package to log user activity in Laravel applications. Admins can view all logs, while users can view only their own logs.

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

[](#installation)

You can install the package via Composer:

```
composer require l0max/laravel-activity-log
```

To publish the configuration file, run the following command:

```
php artisan vendor:publish --provider="L0MAX\ActivityLog\ActivityLogServiceProvider"
```

This will publish the config file `config/activitylog.php`.

Usage
-----

[](#usage)

Once the package is installed, you can use the activity log to track user actions. Each time an action is logged, the `ActivityLog` model stores the user ID and a description of the action.

### Example Usage

[](#example-usage)

```
use L0MAX\ActivityLog\ActivityLog;

ActivityLog::create([
    'user_id' => auth()->id(),
    'description' => 'User performed some action.',
]);
```

### Viewing Logs

[](#viewing-logs)

Admins can view all logs, while regular users can view only their own activity logs.

### Policy

[](#policy)

A policy is included to handle permissions for viewing logs. Here's a simple example of how to control access to activity logs:

```
namespace L0MAX\ActivityLog\Policies;

use App\Models\User;
use L0MAX\ActivityLog\ActivityLog;

class ActivityLogPolicy
{
    public function view(User $user, ActivityLog $log)
    {
        return $user->hasRole('admin') || $user->id === $log->user_id;
    }
}
```

### Database Migrations

[](#database-migrations)

To create the `activity_logs` table, run the migrations:

```
php artisan migrate
```

### Factory

[](#factory)

You can generate test data using the factory provided:

```
ActivityLog::factory()->create();
```

Testing
-------

[](#testing)

You can run the tests with:

```
vendor/bin/phpunit
```

Ensure that you have added the proper testing logic in the `tests/Feature/` directory.

Customization
-------------

[](#customization)

You can customize the package to suit your needs. The following features can be extended:

- Custom log formats
- Additional policies

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [L0MAX](https://github.com/L0M4X)

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance41

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

493d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/02ce737efc37fcb3ef932cdc897676a20be93a61b9293753454e5702ea383967?d=identicon)[L0MAX](/maintainers/L0MAX)

---

Top Contributors

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

---

Tags

phplaravellaravel-packageLaravel SecurityLaravel activityLaravel activity logLaravel log

### Embed Badge

![Health badge](/badges/l0max-laravel-activity-log/health.svg)

```
[![Health](https://phpackages.com/badges/l0max-laravel-activity-log/health.svg)](https://phpackages.com/packages/l0max-laravel-activity-log)
```

###  Alternatives

[jeremykenedy/laravel-logger

Laravel Logger Package

584288.4k1](/packages/jeremykenedy-laravel-logger)[leventcz/laravel-top

Real-time monitoring straight from the command line for Laravel applications.

581105.7k1](/packages/leventcz-laravel-top)[imanghafoori/laravel-password-history

A package to keep a history of all password changes of users

70190.9k1](/packages/imanghafoori-laravel-password-history)[ucan-lab/laravel-blink-logger

Comprehensive Logging Tool for Laravel.

126.1k](/packages/ucan-lab-laravel-blink-logger)

PHPackages © 2026

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