Skip to content
Digisys Alpha
Menu

Laravel · audit log · security · packages

Laravel audit trail: spatie activitylog, laravel-auditing or custom?

For most Laravel apps use a maintained package: spatie/laravel-activitylog for a flexible activity feed, or owen-it/laravel-auditing for per-model change history. Build a small custom append-only table when you need tamper-evidence, strict retention rules or events that are not model changes.

By Ahmed Memon · Published 2026-11-30 · Updated 2026-11-30 · 6 min read

An audit trail answers who did what, to which record, and when. Business platforms with staff, payouts or customer data need one early, because adding it after an incident is too late.

What the public data shows (30 November 2026)

We read package metadata on Packagist and GitHub. We did not benchmark either package for this article.

  • spatie/laravel-activitylog: about 75 million installs, about 5.9 million a month, version 5.1.5 released 13 November 2026. It requires PHP 8.4 and Laravel 12 or 13.
  • owen-it/laravel-auditing: about 46 million installs, about 2.4 million a month, version 14.0.7 released 28 October 2026. It requires PHP 8.2 and Laravel 11, 12 or 13.

Both are widely used and recently released. Note the PHP floor: the activitylog release above needs PHP 8.4, so check your server before you plan an upgrade.

How they differ

  • activitylog is a general activity log: you record events, with a causer and a subject, and can add your own properties. Good for feeds and business events such as payout approved.
  • laravel-auditing focuses on model changes: it stores old and new values for audited models. Good for a field-level history of records.

When to build your own

  • You need an append-only log with no update or delete path, and proof that rows were not edited.
  • Retention and access rules are strict, for example restricted readers and a fixed keep period.
  • Important events are not model changes, such as a failed sign-in, an export or a webhook rejected.
  • You want the log in a separate database or store.

A custom table is small: who, role, action, subject type and ID, before and after for key fields, IP address, outcome and timestamp. The hard part is discipline, not code.

Rules that apply to any choice

  • Never log passwords, tokens or full card numbers.
  • Make the log append-only in the application and restrict who can read it.
  • Log the failure as well as the success.
  • Test that a real action writes exactly one entry.

Our checklist for two-step login and audit logs goes deeper on what to record and what to leave out.

Questions

Which is better, spatie activitylog or laravel-auditing?

Choose activitylog for a flexible feed of business events, and laravel-auditing for automatic old and new values on model changes. Many apps use one and add custom entries for the rest.

Do I need a package for an audit log?

No. A small append-only table works. A package saves time for common cases and a custom table suits strict tamper-evidence and retention rules.

What should an audit log never contain?

Passwords, tokens, full card numbers and other secrets. Mask personal data where you can.

Need this built or reviewed?

Book a 30-minute discovery call or message us on WhatsApp. We reply within one business day.