afea/filament-activity-log

Activity log module for the Afea Filament CMS package ecosystem: wraps rmsramos/activitylog with opinionated config + idempotent install command.

Maintainers

Package info

github.com/AfeaSoftware/filament-activity-log

pkg:composer/afea/filament-activity-log

Statistics

Installs: 1

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-04-21 10:48 UTC

This package is auto-updated.

Last update: 2026-04-21 11:58:01 UTC


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 Settings
  • afea: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:

  1. Publishes config/afea-activity-log.php.
  2. Publishes spatie/laravel-activitylog's migration (skipped if activity_log already exists).
  3. Runs php artisan migrate.
  4. 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.