Activity Log & Audit Trail Timeline (pkg/activitylog)
GoFilament provides an enterprise audit trail system with zero boilerplate:
Enabling Audit on a Resource#
import "github.com/golaravel/gofilament/pkg/activitylog"
// Attach audit logging to any resource
activitylog.EnableAuditLog(productResource)
When attached:
- Every Create, Update, Delete, and Restore action is recorded.
- Intercepts authenticated causer ID, display name, client IP, and User-Agent.
- Generates field-level diffs (
OldValuesvsNewValues).
Embedding Timeline In Infolists#
res.Infolist(func(info *infolists.Infolist) *infolists.Infolist {
return info.Schema(
// Renders vertical audit timeline with expandable before/after diff inspector
activitylog.TimelineEntry("activities"),
)
})
Pre-Configured Standalone Audit Resource#
Mount the administrative audit screen to view all system activity:
adminPanel.Resource(activitylog.NewActivityResource())