onramplab/laravel-auditing-log
spatie/laravel-activitylog, a well-established auditing solution, offering an additional layer of structured logging. This aligns well with systems requiring immutable audit trails (e.g., financial, healthcare, or compliance-sensitive applications).doctrine/dbal for database abstraction, ensuring compatibility with MySQL, PostgreSQL, SQLite, etc., without vendor lock-in.spatie/laravel-activitylog (v4.7+), which may necessitate version alignment if the project already uses an older version. Conflict risk is mitigated by Laravel’s autoloader isolation.spatie/laravel-activitylog is production-ready, but the wrapper package (laravel-auditing-log) has no dependents and a single-star repo, raising concerns about:
schedule).logs/), or supplement them? Overlap may cause data duplication.spatie/laravel-activitylog alone suffice, or does this package add critical value (e.g., pre-built dashboards, export tools)?doctrine/dbal compatibility avoids ORM-specific quirks (e.g., Eloquent’s snake_case conventions).TestModel) to validate:
created, updated).queue:work to test asynchronous logging under load.spatie/laravel-activitylog config to include package-specific fields (e.g., ip_address, device_type).AuditLogCreated).User, Order) with feature flags for gradual adoption.spatie/laravel-activitylog is already installed, composer will auto-resolve versions (check composer.json for ^4.7).AuditLogServiceProvider doesn’t clash with existing bindings (e.g., Activitylog).config/auditing-log.php:
'fields' => [
'old' => true,
'new' => true,
'created_by' => auth()->id(),
],
spatie/laravel-activitylog to v4.7+ if using an older version.doctrine/dbal is installed (Laravel’s php artisan vendor:publish may handle this).composer require onramplab/laravel-auditing-log spatie/laravel-activitylog:^4.7
php artisan vendor:publish --provider="OnrampLab\AuditLog\AuditLogServiceProvider"
config/auditing-log.php to define loggable models and excluded events.audit_logs table.user_agent from middleware).spatie/laravel-activitylog for breaking changes (e.g., schema migrations).onramplab/laravel-auditing-log to a specific version (e.g., 1.0.0) until stability is confirmed.audit_logs table. Migrations must be version-controlled and tested in staging.DB::enableQueryLog()) to diagnose slow audits.telescope or laravel-debugbar to inspect event payloads.audit-logged job) to avoid blocking user requests.DB::statement() to bulk-insert logs.Activity::where('created_at', '<', now()->subYears(1))->delete()).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Database connection drops | Lost audit events | Queue retries + dead-letter queue for failures. |
| Package event listener fails | Incomplete logs | Fallback to manual logging in finally blocks. |
| Schema migration fails | Broken audit trails | Rollback script + manual table repair. |
| High write load | Slow responses | Rate-limiting + queue batching. |
use \OnrampLab\AuditLog\Traits\AuditLoggable;).class Order extends Model {
use AuditLoggable;
protected $auditLogFields = ['status', 'amount'];
}
spatie/laravel-activitylog’s soft-deletes).SELECT COUNT(*) FROM audit_logs).failed_jobs table in Laravel).How can I help you explore Laravel packages today?