PHPackages                             mahedulhasan/audit-logger - 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. [Database &amp; ORM](/categories/database)
4. /
5. mahedulhasan/audit-logger

ActiveLibrary[Database &amp; ORM](/categories/database)

mahedulhasan/audit-logger
=========================

Laravel Audit Logging Package

v1.0.0(6mo ago)02PHP

Since Oct 23Pushed 6mo agoCompare

[ Source](https://github.com/ripuhasan/audit-logger)[ Packagist](https://packagist.org/packages/mahedulhasan/audit-logger)[ RSS](/packages/mahedulhasan-audit-logger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

AuditLogger
===========

[](#auditlogger)

A simple **Laravel Audit Logging Package** to track database changes on your models. Tracks **create, update, delete** events and stores only the **changed fields** in `audit_logs` table.

---

Features
--------

[](#features)

- Logs `created`, `updated`, and `deleted` events automatically
- Only stores changed fields (`old_values` &amp; `new_values`) on updates
- Tracks which user made the changes
- Stores client IP address
- Dynamic observer attachment for all or selected models
- Bootstrap-based view to display audit logs
- Easy to integrate as a Laravel package

---

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

[](#requirements)

- Laravel 9 / 10
- PHP &gt;= 8.1
- MySQL or any database supported by Laravel

---

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

[](#installation)

Require the package via Composer:

```
composer require mahedulhasan/audit-logger
```

> Make sure your `minimum-stability` in `composer.json` allows `dev` packages if needed:

```
"minimum-stability": "dev",
"prefer-stable": true
```

Run the migrations:

```
php artisan migrate
```

(Optional) Publish views/config if you want to customize:

```
php artisan vendor:publish --provider="MahedulHasan\AuditLogger\AuditLoggerServiceProvider"
```

---

Development Version (GitHub)
----------------------------

[](#development-version-github)

If you want to use the latest development version, install directly from GitHub:

1. Add the VCS repository to your project's composer.json:

```
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/ripuhasan/audit-logger"
    }
]
```

2. Require the dev-main branch:

```
composer require mahedulhasan/audit-logger:dev-main
```

Usage
-----

[](#usage)

### Observer

[](#observer)

The package automatically attaches `AuditObserver` to your models. To attach manually:

```
use App\Models\User;
use MahedulHasan\AuditLogger\Observers\AuditObserver;

User::observe(AuditObserver::class);
```

### Display Audit Logs

[](#display-audit-logs)

Visit the route:

```
/audit-logs

```

This route displays a Bootstrap table showing:

- User
- Event (Created / Updated / Deleted)
- Model &amp; ID
- Changed fields (old → new)
- IP Address
- Timestamp

> Note: The route is automatically registered by the package's ServiceProvider.

---

Development
-----------

[](#development)

- Add new migrations in `database/migrations/`
- Add additional observers in `src/Observers/`
- Update views in `resources/views/`
- Run `composer dump-autoload` if you add new namespaces

---

Notes
-----

[](#notes)

- No local installation needed. The package can be installed directly via Composer.
- Ensure ServiceProvider is registered automatically via `extra.laravel.providers` in `composer.json`.
- Migrations, routes, and views are loaded automatically. You only need to run `php artisan migrate`.

---

License
-------

[](#license)

MIT License © \[Mahedul Hasan\]

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance66

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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

198d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0338d586738a411412b6d0649abae85852b13a1cb0a41bcaa550fa82b15dfa80?d=identicon)[ripuhasan](/maintainers/ripuhasan)

---

Top Contributors

[![hasanripu](https://avatars.githubusercontent.com/u/47210144?v=4)](https://github.com/hasanripu "hasanripu (14 commits)")

---

Tags

laravelloggingdatabasetrackingAuditobserverhistoryadminaudit-logmodel events

### Embed Badge

![Health badge](/badges/mahedulhasan-audit-logger/health.svg)

```
[![Health](https://phpackages.com/badges/mahedulhasan-audit-logger/health.svg)](https://phpackages.com/packages/mahedulhasan-audit-logger)
```

###  Alternatives

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[altek/accountant

The auditing &amp; accountability package for Laravel's Eloquent ORM.

92954.3k4](/packages/altek-accountant)[betapeak/laravel-auditing-filesystem

A filesystem driver for the owen-it/laravel-auditing package. Allows storage of the audits in CSV files, across all registered Laravel disks.

166.5k](/packages/betapeak-laravel-auditing-filesystem)

PHPackages © 2026

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