PHPackages                             eddytim/auditlog - 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. eddytim/auditlog

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

eddytim/auditlog
================

Library for inserting and fetching audit logs easily and sending alert to user

v1.0.3(4y ago)0248MITPHP

Since Feb 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/trutimer/AuditLog-package)[ Packagist](https://packagist.org/packages/eddytim/auditlog)[ RSS](/packages/eddytim-auditlog/feed)WikiDiscussions master Synced today

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Audit Log package
=================

[](#audit-log-package)

[![Latest Version](https://camo.githubusercontent.com/f05ea5d5aede3f9bce741aba5892ca3daa52d80af083cd5d6828097cf1929417/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f74727574696d65722f41756469744c6f672d7061636b6167653f7374796c653d666c61742d737175617265)](https://github.com/trutimer/AuditLog-package/releases)[![Issues](https://camo.githubusercontent.com/61c1bdd81b67accc75e844129f42a6c7c96b0fb407d372602e7dfbd040e06d56/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f74727574696d65722f41756469744c6f672d7061636b6167653f7374796c653d666c61742d737175617265)](https://github.com/trutimer/AuditLog-package/issues)[![License](https://camo.githubusercontent.com/183904ec02cf04bc4dd60d4d07d9680e396de0c88e2645e16a9e64b4e6f584ec/68747470733a2f2f706f7365722e707567782e6f72672f6564647974696d2f61756469746c6f672f6c6963656e73652e737667)](https://packagist.org/packages/eddytim/auditlog)

### Library for inserting and fetching audit logs easily and sending alert to user

[](#library-for-inserting-and-fetching-audit-logs-easily-and-sending-alert-to-user)

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

[](#installation)

The Audit Log Service Provider can be installed via [Composer](http://getcomposer.org) by requiring the `eddytim/auditlog` package and setting the `minimum-stability` to `dev` (required for Laravel 5) in your project's `composer.json`.

```
{
    "require": {
        "laravel/framework": "5.0.*",
        "eddytim/auditlog": "^1.0.0"
    },
    "minimum-stability": "dev"
}
```

or

Require this package with composer:

```
composer require eddytim/auditlog

```

Update your packages with `composer update` or install with `composer install`.

Migration
---------

[](#migration)

You need to run migration in order to prepare the table(s) needed for the logs. Run a migration:

`$ php artisan migrate`

Configuration
-------------

[](#configuration)

To insert an email address to send alert, publish config. You will also be able to configure the user model of which audit log belongs to, setting foreign and owner key. You will also be able to set audit log fetch limit of which by default is `50`

`$ php artisan vendor:publish --provider="Eddytim\Auditlog\AuditLogServiceProvider"`

`config/audit.php`

```
return [
    'send_email_to'   => '',
    'user_model' => App\Models\User::class,
    'foreign_key' => 'user_id',
    'owner_key' => 'id',
    'audit_logs_limit' => 50,
];
```

AuditLog Service Provider is automatically added in `config/app.php`, in case it does not, you must register the provider when bootstrapping your Laravel application.

Find the `providers` key in `config/app.php` and register the AuditLog Service Provider.

```
    'providers' => [
        // ...
        'Eddytim\Auditlog\AuditLogServiceProvider',
    ]
```

for Laravel 5.1+

```
    'providers' => [
        // ...
        \Eddytim\Auditlog\AuditLogServiceProvider::class,
    ]
```

Example Usage
-------------

[](#example-usage)

### Default without alert on the log

[](#default-without-alert-on-the-log)

```
    $log = AuditLog::store([
            'event_status' => 'SUCCESS',
            'event_type' => 'Update',
            'user_id' => Auth::id(),
            'description' => 'Changing user name from (old value) to (new value)',
            'table_name' => null, // insert a table name if you will want to track affected table
            'row_id' => null // insert table row id if you will want to track specific affected record
        ]);
```

### With alert on the log

[](#with-alert-on-the-log)

```
// Make sure you have your mail configured and published the vendor so as to specify an email address
    $log = AuditLog::store([
            'event_status' => 'SUCCESS',
            'event_type' => 'Update',
            'user_id' => Auth::id(),
            'description' => 'Changing user name from (old value) to (new value)',
            'table_name' => null, // insert a table name if you will want to track affected table
            'row_id' => null // insert table row id if you will want to track specific affected record
        ], 'This is a message to alert you on the changes');
```

\###Fetching the Logs

```
//    Parameter required is an integer which indicates the offset when fetching the logs
    /**
     * @param $offset
     */
    $logs = AuditLog::getAuditLogs(0);
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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 ~0 days

Total

4

Last Release

1587d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/53305252?v=4)[timer](/maintainers/trutimer)[@trutimer](https://github.com/trutimer)

### Embed Badge

![Health badge](/badges/eddytim-auditlog/health.svg)

```
[![Health](https://phpackages.com/badges/eddytim-auditlog/health.svg)](https://phpackages.com/packages/eddytim-auditlog)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M342](/packages/open-telemetry-sdk)

PHPackages © 2026

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