PHPackages                             bradietilley/laravel-audit-logs - 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. bradietilley/laravel-audit-logs

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

bradietilley/laravel-audit-logs
===============================

Log changes to your models in your Laravel application

01PHP

Since Oct 24Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Audit Logs
==========

[](#audit-logs)

A simple yet flexible implementation of Audit Logging in Laravel.

[![Static Analysis](https://github.com/bradietilley/laravel-audit-logs/actions/workflows/static.yml/badge.svg)](https://github.com/bradietilley/laravel-audit-logs/actions/workflows/static.yml/badge.svg)[![Tests](https://github.com/bradietilley/laravel-audit-logs/actions/workflows/tests.yml/badge.svg)](https://github.com/bradietilley/laravel-audit-logs/actions/workflows/tests.yml/badge.svg)[![Laravel Version](https://camo.githubusercontent.com/bc3085ac176ad9e7534eef3e2c069ae6f49147de8e9cfb433af108fdeb9595a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c25323056657273696f6e2d31312e32382d463933323243)](https://camo.githubusercontent.com/bc3085ac176ad9e7534eef3e2c069ae6f49147de8e9cfb433af108fdeb9595a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c25323056657273696f6e2d31312e32382d463933323243)[![PHP Version](https://camo.githubusercontent.com/0742096904180c78a3bf41632578254b265ae67e07f02a3832a3dc0224fd7c29/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485025323056657273696f6e2d382e332d344635423933)](https://camo.githubusercontent.com/0742096904180c78a3bf41632578254b265ae67e07f02a3832a3dc0224fd7c29/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485025323056657273696f6e2d382e332d344635423933)

Keep an audit record of all modifications made to your eloquent models.

Whether you're tracking security events, other notable events, resource changes, or just everyday actions of users, all of these changes can be described as *Audit Logs*. Use cases of this package are:

- **Regulatory auditing purposes**
    - If you hook up the log stream to point to CloudWatch or similar, the logs can be considered immutable and trustworthy, helping serve the purpose of regulatory auditing.
- **Viewing a resource's history**
    - This package provides a morph ownership to a resource that was affected, such as a resource undergoing updates. This allows you to trace when a resource was modified in a particular way and see the user or resource that performed that action.
- **Viewing a user's actions**
    - This package provides a morph ownership to the user or resource that performed the action, by default this is the authorised user. This allows you to therefore trace a user's steps as they navigate and interact with your application.
- **Analytical reporting**
    - This package can be *extended* to produce reports on user or resource activity.

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

[](#installation)

```
composer require bradietilley/laravel-audit-logs
```

Usage
-----

[](#usage)

### Activity Logs → Resource creation, updates, deletion, restoration

[](#activity-logs--resource-creation-updates-deletion-restoration)

Add the following interface and trait to the model you wish to automatically attach audit logs to:

```
