Weave 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
Auditor Bundle

Auditor Bundle Laravel Package

alli-govender/auditor-bundle

View on GitHub
Deep Wiki
Context7

Doctrine audits logs made easy.

Frequently asked questions about Auditor Bundle
Can AlliGovender’s Auditor Bundle work with Laravel, or is it only for Symfony?
This bundle is Symfony-centric but can be adapted for Laravel. You’d need to replace Symfony’s EventDispatcher with Laravel’s service providers, rewrite annotations for Eloquent models, and bridge the user context (e.g., Auth facade). The core audit logic (event listeners) can be extracted for Laravel use.
How do I install this bundle in a Laravel project?
Since it’s Symfony-focused, you’ll need to manually integrate the underlying `auditor` library. Start by installing via Composer (`composer require alli-govender/auditor-bundle`), then adapt its Doctrine listeners to Laravel’s event system (e.g., `Model::saved()` or `Model::deleted()`).
Which Laravel versions and PHP versions does this bundle support?
The bundle itself requires PHP 7.2+ and Symfony 3.4+. For Laravel, compatibility depends on your custom integration, but PHP 7.4+ is recommended. Test thoroughly with your Laravel version (e.g., 8.x, 9.x) due to Symfony dependencies.
How do I configure which Eloquent models to audit in Laravel?
In Laravel, you’d replace Symfony’s `@Audited` annotations with traits or model observers. For example, add a `HasAudit` trait to models or use `Model::observe()` to trigger audit logic on events like `creating`, `updating`, or `deleting`.
Will this bundle slow down my Laravel application in production?
Audit logging adds database writes for every tracked change, which can impact performance. Mitigate this by batching writes, using queue-based async logging (e.g., Laravel Queues), or auditing only critical models. Monitor write-heavy workloads closely.
Does this bundle automatically create audit tables in Laravel migrations?
No—it’s designed for Symfony’s schema updates. In Laravel, you’d need to manually create audit tables (e.g., `audit_entries`) in migrations. Use Laravel’s `Schema::create()` or a package like `laravel-migrations-generator` to define them.
How do I track the user who made changes in Laravel’s audit logs?
Use Laravel’s `Auth` facade to fetch the authenticated user’s ID in your custom audit logic. For example, inject `Auth::id()` into your observer or trait methods. Anonymous users can be logged as `null` or a default value like `system`.
Are there alternatives to this bundle for Laravel that don’t require Symfony?
Yes. Consider `owen-it/laravel-auditing` (Eloquent-based), `spatie/laravel-activitylog` (flexible logging), or `laravel-audit-log` for simpler needs. These are Laravel-native and avoid Symfony dependencies entirely.
How do I test audit logs in Laravel unit/feature tests?
Mock the audit logic in tests by overriding the observer/trait methods or using Laravel’s `partialMock`. For assertions, compare database snapshots (e.g., `DatabaseMigrations`) or verify audit entries exist with `AuditEntry::where('user_id', $user)->exists()`.
What’s the maintenance status of this fork (alli-govender/auditor-bundle)?
The fork lacks community traction (few stars) compared to the original `damienharper/auditor-bundle`. Check the GitHub issues for activity or consider the original bundle if Symfony compatibility isn’t a blocker. For Laravel, a custom implementation may be more sustainable.
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.
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support