misaf/vendra-activity-log

Installs: 0

Dependents: 4

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

Type:vendra-module

pkg:composer/misaf/vendra-activity-log

dev-master 2026-02-11 12:32 UTC

This package is auto-updated.

Last update: 2026-02-12 00:35:04 UTC


README

A Laravel Filament module for tenant-aware activity logging. It extends Spatie Laravel Activitylog, adds multi-tenancy support, and integrates an Activity Log resource into the Vendra admin panel.

Table of contents

Requirements

Installation

  1. Install the package (ensure spatie/laravel-activitylog is already installed and migrated):

    composer require misaf/vendra-activity-log
  2. Publish and run migrations – First publish Spatie’s activity log table, then this package’s migration (adds tenant_id):

    php artisan vendor:publish --tag=activitylog-migrations
    php artisan vendor:publish --tag=vendra-activity-log-migrations
    php artisan migrate
  3. (Optional) Publish language files:

    php artisan vendor:publish --tag=vendra-activity-log-lang

The plugin is automatically registered on the Filament admin panel. No manual registration is required.

Configuration

Activity log behavior is controlled by config/activitylog.php (from Spatie’s package). This module provides a tenant-aware model that you must set as the activity model:

// config/activitylog.php

return [
    // ...
    'activity_model' => \Misaf\VendraActivityLog\Models\ActivityLog::class,
];

If you don’t have this config yet, publish it from Spatie:

php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-config"

Features

  • Tenant-aware logging – The ActivityLog model uses BelongsToTenant from vendra-tenant; all activities are scoped by tenant.
  • Filament admin UI – Activity Log resource with list and view pages, under Report Management → Activity Logs.
  • Translations – Publishable translation files for multiple languages.
  • Migrations – Adds tenant_id (and index) to the activity log table for multi-tenancy.

Usage

Use Spatie’s activity log API as usual. Activities are stored with the current tenant and appear in the admin panel under Report Management → Activity Logs.

Example:

activity()
    ->causedBy(auth()->user())
    ->performedOn($someModel)
    ->withProperties(['key' => 'value'])
    ->log('Did something');

See Spatie’s documentation for logging on models, batches, and more.

Testing

composer test

Or with PHPUnit:

vendor/bin/pest

License

MIT. See LICENSE.