PHPackages                             gpibarra/laravel-auditable - 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. gpibarra/laravel-auditable

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

gpibarra/laravel-auditable
==========================

A simple Laravel user auditing package for Eloquent Model.

v2.0.1(8y ago)022MITPHPPHP &gt;=7.0CI passing

Since Jun 13Pushed 1y agoCompare

[ Source](https://github.com/gpibarra/laravel-auditable)[ Packagist](https://packagist.org/packages/gpibarra/laravel-auditable)[ Docs](https://github.com/yajra/laravel-auditable)[ RSS](/packages/gpibarra-laravel-auditable/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (15)Used By (0)

Laravel Auditable
=================

[](#laravel-auditable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4461452249c89172a1b893c30e97e348f40bf3813c54f2a93bb46a9e36f1544d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79616a72612f6c61726176656c2d617564697461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yajra/laravel-auditable)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

[![Continuous Integration](https://github.com/yajra/laravel-auditable/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/yajra/laravel-auditable/actions/workflows/continuous-integration.yml)[![Static Analysis](https://github.com/yajra/laravel-auditable/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/yajra/laravel-auditable/actions/workflows/static-analysis.yml)[![Total Downloads](https://camo.githubusercontent.com/5115f89179b63f36adb4460029ce65756236e2d103b27a002a047476b7f47d20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79616a72612f6c61726176656c2d617564697461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yajra/laravel-auditable)

Laravel Auditable is a simple Laravel auditing package for your Eloquent Model. This package automatically inserts/updates an audit log on your table on who created and last updated the record.

Laravel Version Compatibility
-----------------------------

[](#laravel-version-compatibility)

LaravelPackage5.x-10.x4.x11.x11.x12.x12.xInstall via Composer
--------------------

[](#install-via-composer)

```
composer require yajra/laravel-auditable:^12
```

Publish config file
-------------------

[](#publish-config-file)

If you want to modify the `withDefault` option on auditable columns, you may publish the config file.

```
php artisan vendor:publish --tag=auditable
```

Usage
-----

[](#usage)

Update your model's migration and add `created_by` and `updated_by` field using the `auditable()` blueprint macro.

```
Schema::create('users', function (Blueprint $table) {
    $table->increments('id');
    $table->string('name', 100);
    $table->auditable();
    $table->timestamps();
});
```

Then use `AuditableTrait` on your model.

```
namespace App;

use Yajra\Auditable\AuditableTrait;

class User extends Model
{
    use AuditableTrait;
}
```

Soft Deletes
------------

[](#soft-deletes)

If you wish to use Laravel's soft deletes, use the `auditableWithDeletes()` method on your migration instead:

```
Schema::create('users', function (Blueprint $table) {
    $table->increments('id');
    $table->string('name', 100);
    $table->auditableWithDeletes();
    $table->timestamps();
    $table->softDeletes()
});
```

Afterwards, you need to use `AuditableWithDeletesTrait` on your model.

```
namespace App;

use Yajra\Auditable\AuditableWithDeletesTrait;

class User extends Model
{
    use AuditableWithDeletesTrait, SoftDeletes;
}
```

Dropping columns
----------------

[](#dropping-columns)

You can drop auditable columns using `dropAuditable()` method, or `dropAuditableWithDeletes()` if using soft deletes.

```
Schema::create('users', function (Blueprint $table) {
    $table->dropAuditable();
});
```

And you're done! The package will now automatically add a basic audit log for your model to track who inserted and last updated your records.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Arjay Angeles](https://github.com/yajra)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 79.5% 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 ~95 days

Recently: every ~121 days

Total

12

Last Release

2574d ago

Major Versions

0.1.2 → v1.0.02016-11-18

v1.1.3 → v2.0.02017-12-28

PHP version history (2 changes)0.1.0PHP &gt;=5.5.9

v2.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21188012?v=4)[Gerardo Ibarra](/maintainers/gpibarra)[@gpibarra](https://github.com/gpibarra)

---

Top Contributors

[![yajra](https://avatars.githubusercontent.com/u/2687997?v=4)](https://github.com/yajra "yajra (101 commits)")[![rigibore-charlie](https://avatars.githubusercontent.com/u/63846513?v=4)](https://github.com/rigibore-charlie "rigibore-charlie (8 commits)")[![schonhoff](https://avatars.githubusercontent.com/u/42345405?v=4)](https://github.com/schonhoff "schonhoff (4 commits)")[![GoatFreezy](https://avatars.githubusercontent.com/u/25383505?v=4)](https://github.com/GoatFreezy "GoatFreezy (3 commits)")[![jidago](https://avatars.githubusercontent.com/u/56063120?v=4)](https://github.com/jidago "jidago (2 commits)")[![gpibarra](https://avatars.githubusercontent.com/u/21188012?v=4)](https://github.com/gpibarra "gpibarra (1 commits)")[![ivanfernz](https://avatars.githubusercontent.com/u/33168779?v=4)](https://github.com/ivanfernz "ivanfernz (1 commits)")[![22Nick22](https://avatars.githubusercontent.com/u/13195384?v=4)](https://github.com/22Nick22 "22Nick22 (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![redredimano](https://avatars.githubusercontent.com/u/135292528?v=4)](https://github.com/redredimano "redredimano (1 commits)")[![ejgandelaberon](https://avatars.githubusercontent.com/u/23096901?v=4)](https://github.com/ejgandelaberon "ejgandelaberon (1 commits)")[![DarrelEnano](https://avatars.githubusercontent.com/u/83271674?v=4)](https://github.com/DarrelEnano "DarrelEnano (1 commits)")[![shairayo](https://avatars.githubusercontent.com/u/115797032?v=4)](https://github.com/shairayo "shairayo (1 commits)")[![brandpublico](https://avatars.githubusercontent.com/u/73121702?v=4)](https://github.com/brandpublico "brandpublico (1 commits)")

---

Tags

laravelyajraAuditable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gpibarra-laravel-auditable/health.svg)

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

###  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)[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k33.8M339](/packages/yajra-laravel-datatables-oracle)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8703.0M17](/packages/yajra-laravel-oci8)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[yajra/laravel-auditable

A simple Laravel user auditing package for Eloquent Model.

170247.3k3](/packages/yajra-laravel-auditable)

PHPackages © 2026

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