aedart/athenaeum-audit

Audit trail package for Laravel Eloquent

Maintainers

👁 aedart

Package info

github.com/aedart/athenaeum-audit

Homepage

pkg:composer/aedart/athenaeum-audit

Statistics

Installs: 2 579

Dependents: 0

Suggesters: 0

Stars: 0

10.10.0 2026-06-08 07:23 UTC

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause fac5c0022c32db9ab8f8d652d09861106d5de697

  • Alin Eugen Deac <aedart.woop@gmail.com>

eloquenthistoryAudit Logaudit trailAthenaeum

This package is auto-updated.

Last update: 2026-06-23 06:47:39 UTC


README

An audit trail package for Laravel Eloquent Model. It is able to store the changes made on a given model into an "audit trails" table, along with the attributes that have been changed.

Example

namespace Acme\Models;

use Illuminate\Database\Eloquent\Model;
use Aedart\Audit\Traits\RecordsChanges;

class Category extends Model
{
 use RecordsChanges;
}

Later in your application...

$category = Category::create( [ 'name' => 'My category' ]);

// Obtain the "changes" made (in this case a "create" event) 
$changes = $category->recordedChanges()->first();

print_r($changes->toArray());

// Example output:
// [
// "id" => 1
// "user_id" => null
// "auditable_type" => "Acme\Models\Category"
// "auditable_id" => "24"
// "type" => "created"
// "message" => "Recording created event"
// "original_data" => null
// "changed_data" => [
// "name" => "My Category"
// "id" => 1
// ]
// "performed_at" => "2021-04-28T11:07:24.000000Z"
// "created_at" => "2021-04-28T11:07:24.000000Z"
// ]

Documentation

Please read the official documentation for additional information.

Repository

The mono repository is located at github.com/aedart/athenaeum

Versioning

This package follows Semantic Versioning 2.0.0

License

BSD-3-Clause, Read the LICENSE file included in this package