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
composer require afea/filament-activity-log
php artisan afea:install:activity-logThat 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.
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();
}
}// config/afea-activity-log.php
'filament' => [
'navigation_group' => 'Audit',
'navigation_sort' => 10,
'navigation_label' => 'Change history',
],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();
})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.