nawasara/audit
最新稳定版本:v0.1.0
Composer 安装命令:
composer require nawasara/audit
包简介
Audit trail, activity logging, and login attempt tracking for the Nawasara superapp framework.
README 文档
README
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.
composer require nawasara/audit
php artisan migrate
php artisan db:seed --class="Nawasara\Audit\Database\Seeders\PermissionSeeder" --force
Usage
Enable activity logging on any Eloquent model:
use Spatie\Activitylog\Traits\LogsActivity; use Spatie\Activitylog\LogOptions; class Post extends Model { use LogsActivity; public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logOnly(['title', 'body']) ->logOnlyDirty(); } }
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 |
Author
Pringgo J. Saputro <odyinggo@gmail.com>
License
MIT
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-09