PHPackages                             rashidsiaghi/laravel-activitylog - 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. rashidsiaghi/laravel-activitylog

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

rashidsiaghi/laravel-activitylog
================================

Custom activity log system based on Spatie Laravel Activitylog

1.0.1(11mo ago)02MITPHPPHP ^8.1

Since Jun 12Pushed 11mo agoCompare

[ Source](https://github.com/rashid202445/laravel-activitylog)[ Packagist](https://packagist.org/packages/rashidsiaghi/laravel-activitylog)[ Docs](https://github.com/rashid202445/activitylog)[ RSS](/packages/rashidsiaghi-laravel-activitylog/feed)WikiDiscussions master Synced 1mo ago

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

RashidSiaghi Activity Logger (Based on Spatie Laravel Activitylog)
==================================================================

[](#rashidsiaghi-activity-logger-based-on-spatie-laravel-activitylog)

This package is a customized activity logging system for Laravel, extending and modifying the excellent [Spatie Laravel Activitylog](https://github.com/spatie/laravel-activitylog).

✅ Features
----------

[](#-features)

- Logs model attributes, including nested and relationship changes.
- Adds tracking for device info, IP address, browser, and user role.
- Customizable pipelines and event descriptions.
- Built-in support for `hasMany`, `belongsToMany`, and `morphMany` relationships.

📦 Based On
----------

[](#-based-on)

Log activity inside your Laravel app
====================================

[](#log-activity-inside-your-laravel-app)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c5c308df593563148846456c8700bd5e53bc0022643f4ab0b8beff9e69f6892e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261736869647369616768692f6c61726176656c2d61637469766974796c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rashidsiaghi/laravel-activitylog)[![GitHub Workflow Status](https://camo.githubusercontent.com/416f4038abb1f08020aa134c9520c4710c961382ea465f9f4324483a539e6196/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7261736869647369616768692f6c61726176656c2d61637469766974796c6f672f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d5465737473)](https://github.com/rashid202445/laravel-activitylog/actions/workflows/run-tests.yml)[![Check & fix styling](https://github.com/rashid202445/laravel-activitylog/workflows/Check%20&%20fix%20styling/badge.svg)](https://github.com/rashid202445/laravel-activitylog/actions/workflows/php-cs-fixer.yml)[![Total Downloads](https://camo.githubusercontent.com/207b7ecfa91995902db2fd8bb10b76f9d9ca05244bc560a1aa408ba90311532d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7261736869643230323434352f6c61726176656c2d61637469766974796c6f672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rashid202445/laravel-activitylog)

The `rashidsiaghi/laravel-activitylog` package provides easy to use functions to log the activities of the users of your app. It can also automatically log model events. The Package stores all activity in the `activity_log` table.

Here's a demo of how you can use it:

```
activity()->log('Look, I logged something');
```

You can retrieve all activity using the `rashidsiaghi\Activitylog\Models\Activity` model.

```
Activity::all();
```

Here's a more advanced example:

```
activity()
   ->performedOn($anEloquentModel)
   ->causedBy($user)
   ->withProperties(['customProperty' => 'customValue'])
   ->log('Look, I logged something');

$lastLoggedActivity = Activity::all()->last();

$lastLoggedActivity->subject; //returns an instance of an eloquent model
$lastLoggedActivity->causer; //returns an instance of your user model
$lastLoggedActivity->getExtraProperty('customProperty'); //returns 'customValue'
$lastLoggedActivity->description; //returns 'Look, I logged something'
```

Here's an example on [event logging](https://spatie.be/docs/laravel-activitylog/advanced-usage/logging-model-events).

```
$newsItem->name = 'updated name';
$newsItem->save();

//updating the newsItem will cause the logging of an activity
$activity = Activity::all()->last();

$activity->description; //returns 'updated'
$activity->subject; //returns the instance of NewsItem that was saved
```

Calling `$activity->changes()` will return this array:

```
[
   'attributes' => [
        'name' => 'updated name',
        'text' => 'Lorum',
    ],
    'old' => [
        'name' => 'original name',
        'text' => 'Lorum',
    ],
];
```

Attribution
-----------

[](#attribution)

This activity logging system is based on [rashidsiaghi Laravel Activitylog](https://github.com/rashid202445/laravel-activitylog), released under the MIT License.
Modifications have been made to support relationship logging, trait extension, and additional device/user context features.

> This code is **derived from** and **heavily inspired by** [spatie/laravel-activitylog](https://github.com/spatie/laravel-activitylog), originally created by [Spatie](https://spatie.be/opensource).

We thank the Spatie team for their excellent work, which serves as the foundation of this customized version.

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

[](#installation)

You can install the package via composer:

```
composer require rashidsiaghi/laravel-activitylog
```

The package will automatically register itself.

You can publish the migration with:

```
php artisan vendor:publish --provider="RashidSiaghi\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations"
```

*Note*: The default migration assumes you are using integers for your model IDs. If you are using UUIDs, or some other format, adjust the format of the subject\_id and causer\_id fields in the published migration before continuing.

After publishing the migration you can create the `activity_log` table by running the migrations:

```
php artisan migrate
```

You can optionally publish the config file with:

```
php artisan vendor:publish --provider="RashidSiaghi\Activitylog\ActivitylogServiceProvider" --tag="activitylog-config"
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes.

Upgrading
---------

[](#upgrading)

Please see [UPGRADING](UPGRADING.md) for details.

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/rashid202445/.github/blob/main/CONTRIBUTING.md) for details.

🔒 License
---------

[](#-license)

This project and all modified code are released under the [MIT License](LICENSE).
Original copyright © [Spatie](https://spatie.be).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance52

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

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

335d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/101e9567daacd83a236252e3fe775d1d0c8613f56582348affebbbf2c90a7b2a?d=identicon)[RashidSiaghi](/maintainers/RashidSiaghi)

---

Top Contributors

[![rashid202445](https://avatars.githubusercontent.com/u/166951864?v=4)](https://github.com/rashid202445 "rashid202445 (3 commits)")

---

Tags

loglaraveluseractivityrashidsiaghi

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/rashidsiaghi-laravel-activitylog/health.svg)

```
[![Health](https://phpackages.com/badges/rashidsiaghi-laravel-activitylog/health.svg)](https://phpackages.com/packages/rashidsiaghi-laravel-activitylog)
```

###  Alternatives

[spatie/laravel-activitylog

A very simple activity logger to monitor the users of your website or application

5.8k45.4M309](/packages/spatie-laravel-activitylog)[msonowal/laravel-auditor

A simple mongo activity logger to record various events of your laravel application

1030.2k1](/packages/msonowal-laravel-auditor)

PHPackages © 2026

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