Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Auditing

Laravel Auditing Laravel Package

owen-it/laravel-auditing

Track and review changes to your Eloquent models with minimal setup. Laravel Auditing stores a history of updates, helps spot discrepancies or suspicious activity, and makes it easy to retrieve and display audit records in your Laravel app.

View on GitHub
Deep Wiki
Context7

owen-it/laravel-auditing adds audit trails to your Laravel app by tracking changes on Eloquent models with a simple trait. It records who changed what and when, helping you spot discrepancies, enforce accountability, and investigate suspicious activity.

Audited data is easy to query and present, making it suitable for admin panels, compliance logs, and change history views.

  • Trait-based auditing for Eloquent models
  • Stores old/new values for create, update, delete (and more)
  • Capture user, tags, metadata, and request context
  • Simple retrieval & display of audit history
  • Configurable drivers, events, and exclusions
Frequently asked questions about Laravel Auditing
How do I start auditing a Laravel Eloquent model with this package?
Add the `Auditable` trait to your model class. The package automatically captures create, update, delete, and restore events. Run the provided migration to create the `audits` table, and you’re ready to track changes without extra code.
Does this package support Laravel 10.x or older versions?
No, the package officially supports Laravel 11.x–13.x (PHP 8.2+). For Laravel 10.x, downgrade to version 13.x of the package, but check the changelog for compatibility notes, as some features may differ.
Can I exclude sensitive fields from being audited?
Yes, use the `auditExclude` config option in `config/auditing.php` to specify fields that should never be logged. Alternatively, override the `getAuditExclude()` method in your model to dynamically control exclusions.
How does performance impact scale with high-write applications?
Each audit event triggers a database write, which can slow down high-throughput systems. Mitigate this by auditing only critical models, using `shouldAudit()` to filter events, or implementing a custom queue listener for batch processing.
Is there a way to customize who or what triggers an audit log entry?
Yes, implement custom `UserResolver` or `AttributeResolver` interfaces to dynamically set audit metadata like user IDs, IP addresses, or URLs. The package provides built-in resolvers for common use cases.
Can I store audit logs in Redis or Elasticsearch instead of the database?
Yes, the package supports custom audit drivers via the `AuditDriver` contract. You can create a driver for Redis, Elasticsearch, or other storage backends to optimize for search or analytics.
How do I retrieve and display audit history for a model?
Use the `audits()` method on your model instance to fetch a collection of audit records. Each record includes old/new values, timestamps, and metadata. Paginate results for large datasets with `audits()->paginate(10)`.
What happens if I upgrade from an older version of this package?
Check the changelog for breaking changes, especially in major versions (e.g., v8.0.0 removed `audit.redact`). Some updates, like adding `updated_at` to the audits table in v4.1.0, may require manual migration adjustments.
Does this package work with Laravel Lumen?
Yes, the package is tested and compatible with Lumen. The same installation and configuration steps apply, as Lumen shares Laravel’s Eloquent and event systems.
Are there alternatives to this package for Laravel model auditing?
Yes, alternatives include `spatie/laravel-activitylog` (feature-rich but heavier) and `laravel-audit-log` (simpler but less flexible). Choose based on your needs: this package excels in minimal setup and extensibility for Laravel-specific use cases.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport