afea / filament-activity-log
Activity log module for the Afea Filament CMS package ecosystem: wraps rmsramos/activitylog with opinionated config + idempotent install command.
v0.1.0
2026-04-21 10:48 UTC
Requires
- php: ^8.4
- afea/filament-cms-core: @dev
- filament/filament: ^4.0
- illuminate/contracts: ^12.0
- illuminate/support: ^12.0
- laravel/prompts: ^0.3
- rmsramos/activitylog: ^2.0
- spatie/laravel-activitylog: ^4.8
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
README
Activity log module for the Afea Filament CMS package ecosystem.
Thin opinionated wrapper around the excellent rmsramos/activitylog plugin (itself built on top of spatie/laravel-activitylog).
Ships:
ActivityLogPlugin— wraps rmsramos' plugin, applies our nav group / sort defaults so the page lands alongside Redirects, Backups, and Settingsafea:install:activity-log— idempotent installer: publishes config + spatie activity log migrations, runs migrate, patches the panel provider
Installation
composer require afea/filament-activity-log php artisan afea:install:activity-log
That single command:
- Publishes
config/afea-activity-log.php. - Publishes spatie/laravel-activitylog's migration (skipped if
activity_logalready exists). - Runs
php artisan migrate. - Appends
->plugin(\Afea\Cms\ActivityLog\Filament\ActivityLogPlugin::make())to your panel provider.
Re-running is safe — idempotent at every step.
Three common scenarios
1. Log a specific model
use Spatie\Activitylog\Traits\LogsActivity; use Spatie\Activitylog\LogOptions; class BlogPost extends Model { use LogsActivity; public function getActivitylogOptions(): LogOptions { return LogOptions::defaults() ->logFillable() ->logOnlyDirty() ->dontSubmitEmptyLogs(); } }
2. Change the navigation placement
// config/afea-activity-log.php 'filament' => [ 'navigation_group' => 'Audit', 'navigation_sort' => 10, 'navigation_label' => 'Change history', ],
3. Prune old entries
Schedule spatie/activity-log's cleanup command to keep the table lean:
// bootstrap/app.php ->withSchedule(function (\Illuminate\Console\Scheduling\Schedule $schedule) { $schedule->command('activitylog:clean')->weekly(); })
Authorization
By default the resource is visible to every authenticated user. Lock it down with ->authorize(fn () => auth()->user()?->hasRole('super_admin')) on the rmsramos plugin — or let bezhansalleh/filament-shield generate a policy for ActivityResource.