- What does mblsolutions/audit-logging do in a Laravel application?
- It records model and application events in a structured audit trail so teams can see who changed what, when, and from where. The package automatically audits model created, updated, and deleted events and stores records using configurable storage, typically your existing database. It also captures user and request context and supports custom events and metadata.
- How do I install and configure mblsolutions/audit-logging?
- Install the package with Composer and follow its documented setup for configuration and migrations. Review the storage driver and audit table settings so records land in the right database, then confirm your PHP and Laravel constraints match the package support matrix. The v2.1.0 release is described as an additive minor change from 2.0.x with no deprecations or breaking changes noted.
- Which Laravel and PHP versions does mblsolutions/audit-logging support?
- The provided context does not list an exact Laravel or PHP support matrix, so check the package composer.json and documentation before upgrading. The v2.0.1 to v2.1.0 release is a minor bump with one feature and no deprecations or breaking changes in the notes. If you are moving from 2.0.x, verify that the PHP and Laravel constraints are unchanged.
- Does mblsolutions/audit-logging automatically audit model created, updated, and deleted events?
- Yes. Automatic model auditing covers created, updated, and deleted events without adding boilerplate to every model. Audit entries include changed values and attribution so you can review activity and debug issues more easily.
- How does mblsolutions/audit-logging capture user and request context?
- Each audit entry captures user and request context alongside the model event and changed values. That lets you identify the actor and the request that caused the change, answering who changed what, when, and from where. This context is stored in the audit record rather than being scattered through custom logging calls.
- Can I add custom audit events and metadata with mblsolutions/audit-logging?
- Yes. The package supports custom events and metadata for application-specific activity beyond standard model events. This is useful for domain actions that matter to compliance reviews or debugging. Keep metadata focused because large before-and-after payloads increase storage use and, with external sinks such as CloudWatch, ingest cost.
- Where are audit records stored, and how do I query and clean them up?
- Audit records use configurable storage and are designed to live in your existing database, which keeps them queryable with normal Laravel database tooling. The package includes simple querying and cleanup helpers for reviewing and pruning audit history. If you add an external sink such as CloudWatch, configure retention there as well instead of relying on manual console work.
- Is the CloudWatch driver suitable for compliance audit logs?
- The CloudWatch driver is additive in v2.1.0, but the published release notes do not document delivery semantics, schema parity, or failure behavior. For compliance use, confirm whether a CloudWatch write failure throws, is swallowed, or falls back to a durable buffer before making CloudWatch the system of record. A safer migration is to keep your current audit store primary, dual-write to CloudWatch during a soak window, and reconcile event counts.
- Does the CloudWatch driver batch, buffer, and retry writes?
- The assessment flags batching and backoff as requirements but does not confirm that the driver implements them. CloudWatch PutLogEvents has per-event and per-batch limits plus per-stream throttling, so a synchronous write per audit event would add latency and risk throttling under load. Verify in code and tests whether the driver batches, retries with backoff, and uses an in-memory or durable buffer.
- Is mblsolutions/audit-logging actively maintained, and what alternatives exist?
- The assessment describes a single-organisation package with a small contributor base, and the CloudWatch driver arrived as a first-time contributor's initial pull request. That does not make it unsuitable, but review release cadence, issue responsiveness, and review depth before relying on it for compliance. Alternatives include spatie/laravel-activitylog, custom model observers writing to an audit table, or database-level change capture, depending on whether you need model diffs, custom events, or an immutable external sink.