Yammi Audit Log for Laravel: Track Changes Across Queues | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com) [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles  ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://msaied.com) [ Projects ](https://msaied.com/projects) [ Articles ](https://msaied.com/articles) [ Certificates ](https://msaied.com/certificates) [ Contact ](https://msaied.com#contact-section) 

  [ home ](https://msaied.com)    [ articles ](https://msaied.com/articles)    Yammi Audit Log: Track Who Really Made a Change Across Laravel Jobs and Queues        On this page       1. [  The Problem with Audit Logs and Queued Jobs ](#the-problem-with-audit-logs-and-queued-jobs)
2. [  Zero Per-Model Configuration ](#zero-per-model-configuration)
3. [  Keeping the Actor Through Queued Work ](#keeping-the-actor-through-queued-work)
4. [  Designed to Stay Out of the Way ](#designed-to-stay-out-of-the-way)
5. [  Optional Forensics and Compliance Features ](#optional-forensics-and-compliance-features)
6. [  Key Takeaways ](#key-takeaways)

  ![Yammi Audit Log: Track Who Really Made a Change Across Laravel Jobs and Queues](https://cdn.msaied.com/291/1b51a0aabcdcc3d178526d94ac187f34.png)

 [  Laravel ](https://msaied.com/articles?category=laravel) [  Composer Pacakge ](https://msaied.com/articles?category=composer-pacakge)  #audit log   #laravel package   #queues   #eloquent   #compliance   #tracing  

 Yammi Audit Log: Track Who Really Made a Change Across Laravel Jobs and Queues 
================================================================================

     24 Jun 2026      4 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   The Problem with Audit Logs and Queued Jobs  ](#the-problem-with-audit-logs-and-queued-jobs)
2. [  02   Zero Per-Model Configuration  ](#zero-per-model-configuration)
3. [  03   Keeping the Actor Through Queued Work  ](#keeping-the-actor-through-queued-work)
4. [  04   Designed to Stay Out of the Way  ](#designed-to-stay-out-of-the-way)
5. [  05   Optional Forensics and Compliance Features  ](#optional-forensics-and-compliance-features)
6. [  06   Key Takeaways  ](#key-takeaways)

 The Problem with Audit Logs and Queued Jobs
-------------------------------------------

Most Laravel audit packages handle the straightforward case well: a user updates a record, and the package logs the before and after values along with the authenticated user. The story falls apart the moment that write happens inside a queued job. The queue worker is the process that executes the Eloquent call, so a naive audit trail attributes the change to the worker—not the user who triggered the workflow two hops earlier.

[Yammi Audit Log](https://github.com/RomaLytar/yammi-audit-Log) by RomaLytar solves this by carrying the original actor identity through the entire chain and attaching a correlation ID that groups every related entry—controller action, queued job, Artisan command, or scheduled task—into a single traceable workflow.

Zero Per-Model Configuration
----------------------------

One of Yammi's most practical qualities is that it requires no changes to your existing models. There are no traits to add, no interfaces to implement, and no observers to register. After installing the package and running the migrations, every Eloquent write is captured automatically:

```bash
composer require romalytar/yammi-audit-log-laravel
php artisan migrate

```

```php
User::first()->update(['name' => 'Eric']);
// Already in the audit log — no model changes needed.

```

If you only want to track specific models, switch to opt-in mode in `config/audit-log.php`:

```php
'capture'   => ['mode' => env('AUDIT_LOG_CAPTURE_MODE', 'all')], // all | opt_in
'retention' => ['days' => env('AUDIT_LOG_RETENTION_DAYS', 180)],
'write'     => ['async' => env('AUDIT_LOG_WRITE_ASYNC', false)],

```

**One important caveat:** Yammi hooks into Eloquent model events, so raw Query Builder updates bypass it and must be recorded explicitly.

Keeping the Actor Through Queued Work
-------------------------------------

This is the core differentiator. When a user dispatches a job that later modifies a model, Yammi preserves the original identity so the audit record distinguishes between:

- **The executor** — the process that ran the write (e.g., the queue worker)
- **The initiator** — the user or system that triggered the workflow

The correlation ID then links every entry belonging to the same workflow, letting you reconstruct a cascade of changes across a controller, a queued job, and a scheduled command as a single trace rather than unrelated rows. The context also records *where* the change ran—HTTP request, queued job, Artisan command, or scheduler.

Designed to Stay Out of the Way
-------------------------------

The write path is built for minimal overhead. Each change produces a single insert plus a batched index of changed fields stored in a dedicated indexed table—no JSON column scanning required. Writes can be pushed to a queue to keep them off the critical path:

```php
'write' => ['async' => env('AUDIT_LOG_WRITE_ASYNC', false)],

```

The capture path is also fail-open: if an audit write errors, the underlying operation still completes rather than taking the request down with it.

Optional Forensics and Compliance Features
------------------------------------------

Yammi ships several subsystems that are inactive by default:

- **Integrity mode** — tamper-evident hash chain to detect altered entries
- **Time machine** — reconstruct a record's state at any past point
- **GDPR tooling** — subject reports and retention handling
- **Anomaly detection** and SIEM streaming
- **Slack and webhook alerts**
- **Multi-tenancy support**
- **Optional dashboard** enabled via `php artisan audit-log:ui enable`

Keeping these opt-in means the default install stays close to a plain change log.

Key Takeaways
-------------

- No traits, interfaces, or observers needed—works with existing models out of the box
- Tracks both the *initiator* and the *executor* of a change across queue hops
- Correlation IDs tie an entire workflow (request → job → command) into one trace
- Indexed field table avoids slow JSON column queries
- Fail-open write path protects application stability
- Compliance, forensics, and dashboard features are all opt-in
- Requires PHP 8.1+ and Laravel 9–13

---

Source: [Laravel News — Yammi Audit Log](https://laravel-news.com/yammi-audit-log-track-who-really-made-a-change-across-jobs-and-queues)

 Found this useful?

          [  ](https://twitter.com/intent/tweet?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fyammi-audit-log-track-who-really-made-a-change-across-laravel-jobs-and-queues&text=Yammi+Audit+Log%3A+Track+Who+Really+Made+a+Change+Across+Laravel+Jobs+and+Queues) [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fmsaied.com%2Farticles%2Fyammi-audit-log-track-who-really-made-a-change-across-laravel-jobs-and-queues) 

 Frequently Asked Questions 
----------------------------

  3 questions  

     Q01  Does Yammi Audit Log require changes to existing Eloquent models?        No. Yammi hooks into Eloquent model events globally, so there are no traits, interfaces, or observers to add. Every model is captured automatically after installation and migration, unless you switch to opt-in mode. 

      Q02  How does Yammi correctly attribute changes that happen inside queued jobs?        Yammi carries the original actor identity through the queue chain and records both the initiator (the user or system that triggered the workflow) and the executor (the process that ran the write). A correlation ID groups all related entries—controller, job, command—into a single traceable workflow. 

      Q03  Are the compliance and forensics features enabled by default?        No. Features like tamper-evident hash chains, GDPR tooling, anomaly detection, SIEM streaming, and the dashboard are all opt-in. The default install behaves as a straightforward change log. 

  Continue reading

 More Articles 
---------------

 [ View all    ](https://msaied.com/articles) 

 [ ![Cursor Pagination, Chunked Iteration, and Lazy Collections at Scale in Laravel](https://cdn.msaied.com/292/a09cfdc4dcc65660fb6ada3aae3fa264.png) laravel eloquent performance 

### Cursor Pagination, Chunked Iteration, and Lazy Collections at Scale in Laravel

Offset pagination breaks under large datasets. Learn how cursor pagination, chunked iteration, and lazy collec...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 25 Jun 2026     4 min read  

  Read    

 ](https://msaied.com/articles/cursor-pagination-chunked-iteration-and-lazy-collections-at-scale-in-laravel) [ ![Laravel Job Batching and Chaining: Coordinating Complex Async Workflows](https://cdn.msaied.com/290/3b69072ea0f13031737fb4104c720593.png) laravel queues async 

### Laravel Job Batching and Chaining: Coordinating Complex Async Workflows

Go beyond simple queued jobs. Learn how to compose Laravel job batches and chains to orchestrate multi-step as...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 25 Jun 2026     4 min read  

  Read    

 ](https://msaied.com/articles/laravel-job-batching-and-chaining-coordinating-complex-async-workflows) [ ![FrankenPHP, OPcache JIT, and Preloading: Maximising Laravel Throughput](https://cdn.msaied.com/289/b7db80720c9f35a8631e34515666e691.png) laravel frankenphp opcache 

### FrankenPHP, OPcache JIT, and Preloading: Maximising Laravel Throughput

A practical deep-dive into running Laravel under FrankenPHP with OPcache JIT and preloading enabled — covering...

  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said 

 25 Jun 2026     1 min read  

  Read    

 ](https://msaied.com/articles/frankenphp-opcache-jit-and-preloading-maximising-laravel-throughput) 

   [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://msaied.com)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

Explore

- [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [Contact](https://msaied.com#contact-section)

Connect

- [   hello@msaied.com ](mailto:hello@msaied.com)
- [   +20 109 461 9204 ](tel:+201094619204)

© 2026 Mohamed Said. All rights reserved.

 [  ](https://github.com/EG-Mohamed) [  ](https://www.linkedin.com/in/msaiedm/) [  ](https://wa.me/201094619204) [  ](mailto:hello@msaied.com) [  ](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
