Skip to content

Activity Log

Display spatie/laravel-activitylog entries in the Aura Activity Feed widget with zero boilerplate.

Requirements

  • spatie/laravel-activitylog ^4.0 installed
  • Aura Filament v2.6+

Setup

Create a widget extending AuraSpatieActivityFeed:

use BlueStarSystem\AuraFilament\Widgets\AuraSpatieActivityFeed;

class RecentActivity extends AuraSpatieActivityFeed
{
    protected ?string $heading = 'Recent Activity';
    protected int $limit = 15;
}

That's all you need. The widget queries Activity::with(['causer'])->latest() and maps each record to the activity feed timeline.

Filtering

Filter by log name or subject type:

class ProjectActivity extends AuraSpatieActivityFeed
{
    protected ?string $heading = 'Project Activity';
    protected ?string $logName = 'project';
    protected ?string $subjectType = \App\Models\Project::class;
}

Custom Colors

Override colorFor() to assign colors based on activity content:

protected function colorFor(object $activity): string
{
    return match (true) {
        str_contains($activity->description, 'created') => 'success',
        str_contains($activity->description, 'deleted') => 'danger',
        str_contains($activity->description, 'updated') => 'info',
        default => 'neutral',
    };
}

Auto-Detected Icons

The adapter maps description keywords to icons:

Keyword Icon
created heroicon-o-plus-circle
updated heroicon-o-pencil
deleted heroicon-o-trash
other heroicon-o-information-circle

Property Diff

When spatie tracks old and attributes in the properties JSON, the adapter automatically formats a diff: status: pending → shipped, name: Old → New.