Download the PHP package nawasara/audit without Composer
On this page you can find all versions of the php package nawasara/audit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nawasara/audit
More information about nawasara/audit
Files in nawasara/audit
Package audit
Short Description Audit trail, activity logging, and login attempt tracking for the Nawasara superapp framework.
License MIT
Informations about the package audit
Nawasara Audit
Audit trail, activity logging, and login attempt tracking for the Nawasara superapp framework.
Features
- Activity log. Every significant write action (model create/update/delete) is recorded with the user, timestamp, and field-level diff using
spatie/laravel-activitylog. - Login history. Successful and failed authentication attempts are persisted, including IP address, user agent, and outcome.
- Admin viewer. Livewire pages to browse, filter, and inspect activity log entries and login attempts without leaving Nawasara.
- Permission-gated. Viewing the audit pages requires Spatie permissions seeded by the package.
Installation
This package ships as part of the Nawasara monorepo and is auto-discovered by Laravel.
Usage
Enable activity logging on any Eloquent model:
Login attempts are recorded automatically by the bundled listeners; no caller code is required.
Pages
| Route | Permission | Purpose |
|---|---|---|
/admin/audit/activity |
audit.activity.view |
Filterable activity log viewer |
/admin/audit/login-history |
audit.login.view |
Login attempt history |
Retention and pruning
nawasara-audit:prune deletes rows older than NAWASARA_AUDIT_RETENTION_DAYS (default 90) from the shared activity_log and from nawasara_audit_login_attempts, in batches.
| Variable | Default | Meaning |
|---|---|---|
NAWASARA_AUDIT_RETENTION_DAYS |
90 |
Days to keep. Below 30 or not a whole number: the prune refuses to run |
NAWASARA_AUDIT_PRUNE_ENABLED |
false |
Schedule the prune nightly |
NAWASARA_AUDIT_PRUNE_AT |
02:30 |
Time of day, Asia/Jakarta |
Decisions not to undo:
- The nightly prune is off by default.
activity_logholds the audit trail of every package. The first run on an environment that has never been pruned deletes all older history at once and cannot be undone, so it has to be a deliberate choice: run--dry-run, decide whether 90 days is long enough for every package's audit needs, then turn it on. - A bad retention value stops the prune instead of widening it.
0,9typed for90, or an empty string would otherwise delete nearly everything. The minimum is 30 days (Support\RetentionPolicy). - Until October 2026 nothing read
retention_days. The setting existed and the docs said 90 days while both tables grew without limit.
Author
Pringgo J. Saputro <[email protected]>
License
MIT
All versions of audit with dependencies
illuminate/support Version ^10.0|^12.0
spatie/laravel-activitylog Version ^4.9
nawasara/ui Version *
livewire/livewire Version ^3.0