mayaramyadav/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

Language:Blade

pkg:composer/mayaramyadav/spatie-activitylog-ui

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-04-01 12:39 UTC

This package is auto-updated.

Last update: 2026-04-01 12:44:35 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 mayaramyadav/spatie-activitylog-ui
  2. Publish Configuration: (Optional but recommended)

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

    php artisan vendor:publish --provider="MayaramYadav\SpatieActivitylogUi\SpatieActivitylogUiServiceProvider" --tag="spatie-activitylog-ui-assets"
    php artisan vendor:publish --provider="MayaramYadav\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 dictates the entire appearance and permissions of the package.

Core Settings

'route' => [
    'prefix' => 'spatie-activitylog-ui', // The root URL of the UI
    'middleware' => ['web', 'auth'],     // Who can access the base route
],

Authorization (Gates & Access Control)

By default, the package is locked down out of the box.

'authorization' => [
    'enabled' => true,
    'gate'    => 'viewActivityLogUi', // Intercept via app/Providers/AuthServiceProvider.php
],

'access' => [
    'allowed_users' => ['admin@example.com'], // Or allow specific emails natively
    'allowed_roles' => ['super-admin'],       // Or specific Spatie Roles
],

๐Ÿ’ก 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' => 'spatie_al_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.

๐Ÿ“ License

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