mayaram/spatie-activitylog-ui

A beautiful, modern UI for Spatie's Activity Log with advanced filtering, analytics, and real-time features.

Maintainers

Package info

github.com/mayaramyadav/spatie-activitylog-ui

Homepage

Language:Blade

pkg:composer/mayaram/spatie-activitylog-ui

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.6.0 2026-04-02 12:46 UTC

This package is auto-updated.

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


README

โœจ Spatie Activitylog UI

Latest Version on Packagist Total Downloads License

A beautiful, modern, and lightning-fast user interface for Spatie's Laravel Activitylog.

Note

This package provides an elegant dashboard and analysis interface. It operates securely on top of your existing activity_log table and assumes you already have Spatie's package installed and logging data.

Spatie Activitylog UI Dashboard Screenshot

๐Ÿš€ Key Features

  • ๐Ÿ“Š Comprehensive Dashboards: View intuitive timeline interfaces, aggregated analytics, and detailed data tables.
  • ๐Ÿ”Ž Powerful Filtering: Instantly search by exact dates, specific events, subjects, causers, and models.
  • ๐Ÿ’พ Saved Views: Save your favorite dashboard queries and share default views with your team.
  • โšก Zero Build Steps: Styled beautifully with Tailwind CSS and powered by Alpine.js nativelyโ€”no NPM commands required!
  • ๐Ÿ›ก๏ธ Rock-Solid Security: Built-in authorization gates, flexible middleware support, and granular user/role whitelists.
  • ๐Ÿ“ฅ Robust Exporting System: Export millions of records safely to CSV, JSON, Excel (XLSX), or PDF with built-in Laravel Queue background jobs.

๐Ÿ› ๏ธ Requirements

Before installing, ensure your server meets the following requirements:

  • PHP: ^8.3
  • Laravel: 11.x | 12.x | 13.x
  • Spatie Activitylog: ^5.0

Optional Export Dependencies

If you wish to export to Excel or PDF, simply install the required packages. The UI gracefully falls back to CSV if these are missing.

composer require maatwebsite/excel barryvdh/laravel-dompdf

๐Ÿ“ฆ Installation

  1. Install the package via Composer:

    composer require mayaram/spatie-activitylog-ui
  2. Publish Configuration: (Optional but recommended)

    php artisan vendor:publish --provider="Mayaram\SpatieActivitylogUi\SpatieActivitylogUiServiceProvider" --tag="spatie-activitylog-ui-config"
  3. Publish Assets & Views: (Optional if you wish to override styling)

    php artisan vendor:publish --provider="Mayaram\SpatieActivitylogUi\SpatieActivitylogUiServiceProvider" --tag="spatie-activitylog-ui-assets"
    php artisan vendor:publish --provider="Mayaram\SpatieActivitylogUi\SpatieActivitylogUiServiceProvider" --tag="spatie-activitylog-ui-views"
  4. Verify Database Configuration: If you have not already migrated Spatie's activity log, run:

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

You are now ready to go! ๐ŸŽ‰ Visit /spatie-activitylog-ui in your browser to access the dashboard.

โš™๏ธ Configuration

Your config/spatie-activitylog-ui.php file controls routing, access rules, UI defaults, exports, and analytics behavior.

Core Settings

'route' => [
    'prefix' => 'spatie-activitylog-ui', // The root URL of the UI
    'name' => 'spatie-activitylog-ui.',
    'middleware' => null, // Auto-detected from authorization settings, or set explicitly
],

Authorization (Gates & Access Control)

By default, the UI is publicly reachable through the web middleware and the package gate allows authenticated users when authorization is enabled. Turn authorization on to require login and package-level access checks.

'authorization' => [
    'enabled' => true,
    'gate' => 'viewActivityLogUi',
],

'access' => [
    'allowed_users' => ['admin@example.com'],
    'allowed_roles' => ['super-admin'],
],

If authorization.enabled is false, package routes use only the web middleware unless you override route.middleware manually.

๐Ÿ’ก Analytics & Caching

The dashboard relies on caching to prevent heavy queries from lagging your database when dealing with millions of log rows.

'features' => [
    'analytics' => true,      // Turn on/off the top metrics bar
],

'performance' => [
    'cache_prefix' => 'activitylog_ui',
    'eager_load_relations' => ['causer', 'subject'], // Optimize N+1 issues
],

๐Ÿ–ฅ๏ธ Background Export Jobs

If your database contains millions of rows, attempting to export them via HTTP will likely result in a timeout. We bypass this by queuing exports seamlessly:

'exports' => [
    'enabled_formats' => ['csv', 'xlsx', 'pdf', 'json'],
    
    // Limits
    'max_records' => 100000, 
    
    'queue' => [
        'enabled'   => true, // Run exports via the Laravel Job queue!
        'queue_name'=> 'exports',
    ],
    
    // Get alerted when large exports are ready to download
    'notifications' => [
        'enabled' => true,
        'channels' => ['mail'] 
    ]
],

๐Ÿค Contributing

We welcome your PRs and feature requests! Please open an issue to discuss major changes before making a pull request.

โœ… Testing

The package uses PHPUnit with Orchestra Testbench.

composer test

The current test suite covers package bootstrapping, route registration, and access gate behavior.

๐Ÿ“ License

This package is free and open-source software distributed under the terms of the MIT License. See LICENSE for details.