PHPackages                             ekoyanu99/laravel-activitylog-ui - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ekoyanu99/laravel-activitylog-ui

ActiveLibrary

ekoyanu99/laravel-activitylog-ui
================================

Bootstrap + jQuery activity log dashboard UI for Spatie laravel-activitylog

v1.0.0(1mo ago)00MITPHPPHP ^8.2|^8.3|^8.4

Since Jul 18Pushed 1mo agoCompare

[ Source](https://github.com/ekoyanu99/laravel-activitylog-ui)[ Packagist](https://packagist.org/packages/ekoyanu99/laravel-activitylog-ui)[ RSS](/packages/ekoyanu99-laravel-activitylog-ui/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Laravel Activity Log UI
=======================

[](#laravel-activity-log-ui)

> Beautiful, modern UI for [Spatie's Activity Log](https://github.com/spatie/laravel-activitylog)
>
> **Important:** This package **assumes you already have Spatie's Activity Log installed and configured** in your Laravel application. It does *not* replace the logging package—only provides a powerful UI for viewing and analyzing the stored activities.

[![Activity Log UI Screenshot](laravel-activitylog-ui-screenshot.png)](laravel-activitylog-ui-screenshot.png)

---

✨ Features
----------

[](#-features)

### Dashboard Views

[](#dashboard-views)

- **Table View**: Sortable, paginated activity log with inline details modal
- **Timeline View**: Chronological activity visualization grouped by date
- **Analytics Dashboard**: Statistics, trends, heatmap, user profiles, and popular models

### Filtering &amp; Search

[](#filtering--search)

- Advanced filter panel with date presets (today, last 7/30 days, this/last month, custom range)
- Filter by event type, user/causer, subject model, and search across descriptions
- Real-time filter suggestions

### Saved Preferences

[](#saved-preferences)

- Save custom filter configurations as reusable views
- Per-page display options (10, 25, 50, 100 per page)
- Sort and pagination preferences

### Analytics &amp; Insights

[](#analytics--insights)

- Total, daily, weekly, and monthly activity counts
- Active users count
- Event type breakdown with percentages
- Top active users and popular models
- 30-day activity trends chart
- Activity heatmap (365 days)
- User activity profiles with event breakdown and daily stats

### Exports

[](#exports)

- Export to **CSV** (built-in)
- Export to **Excel (XLSX)** (requires `maatwebsite/excel`)
- Export to **PDF** (requires `barryvdh/laravel-dompdf`)
- Export to **JSON** (built-in)
- Queued exports for large datasets (&gt;1000 records)
- Automatic cleanup of old export files
- Email notifications for queued exports

### Authorization &amp; Access

[](#authorization--access)

- Authorization gate (`viewActivityLogUi`) auto-registered
- Optional email/role-based access whitelisting
- Configurable middleware stack
- Middleware granular control

### Performance &amp; UX

[](#performance--ux)

- Cached analytics (default 1 hour TTL, configurable)
- Pagination powered by Laravel cache
- No build step required (Bootstrap 5 + jQuery)
- AJAX-powered filtering and data loading

🗒️ Requirements
---------------

[](#️-requirements)

- **PHP** ≥ 8.4
- **Laravel** 12 | 13 (auto-discovery enabled)
- **[spatie/laravel-activitylog](https://github.com/spatie/laravel-activitylog)** ≥ 5.0 (must be installed and configured)
    - Table `activity_log` must exist with Spatie v5 schema (includes `attribute_changes` column)
    - Activities must be logged via Spatie package before UI will display data

### Optional Dependencies

[](#optional-dependencies)

For enhanced export functionality, install these packages:

FeaturePackageVersionNotesExcel (XLSX)`maatwebsite/excel`^3.1Falls back to CSV if not installedPDF`barryvdh/laravel-dompdf`^2.0Falls back to JSON if not installedQueued ExportsBuilt-in with Laravel queues-Enable in configRole-based Access`spatie/laravel-permission`^6.0Optional, for role checksInstall export packages when needed:

```
composer require maatwebsite/excel barryvdh/laravel-dompdf
```

---

🚀 Installation
--------------

[](#-installation)

1. **Install the package**

    ```
     composer require ekoyanu99/laravel-activitylog-ui
    ```
2. **(Optional) Publish resources**

    ```
    # Config file (config/activitylog-ui.php)
     php artisan vendor:publish --provider="ekoyanu99\ActivitylogUi\ActivitylogUiServiceProvider" --tag="activitylog-ui-config"

    # Blade views (if you want to customise)
     php artisan vendor:publish --provider="ekoyanu99\ActivitylogUi\ActivitylogUiServiceProvider" --tag="activitylog-ui-views"

    # Public assets (logo, js, css)
     php artisan vendor:publish --provider="ekoyanu99\ActivitylogUi\ActivitylogUiServiceProvider" --tag="activitylog-ui-assets"
    ```
3. **Run migrations**
    Ensure you have already run Spatie’s migrations so the `activity_log` table exists:

    ```
    php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" --tag="activitylog-migrations"
    php artisan migrate
    ```
4. **Verify Spatie is logging activities**

    Make sure your models are using Spatie's activity logging:

    ```
    use Spatie\Activitylog\Traits\LogsActivity;

    class YourModel extends Model {
        use LogsActivity;
    }
    ```
5. **Visit the UI**

    Once installed, access the dashboard:

    ```
    http://yourapp.local/activitylog-ui   # primary route
    http://yourapp.local/ActivityLog      # legacy route (for backward compatibility)

    ```

### Local package development (path repository)

[](#local-package-development-path-repository)

If you are developing this package locally and want to test it in a Laravel app, add this to your host app `composer.json`:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "../laravel-activity-ui",
      "options": {
        "symlink": true
      }
    }
  ]
}
```

Then install from your host app:

```
composer require ekoyanu99/laravel-activitylog-ui:@dev
```

This package also keeps legacy route compatibility for existing jQuery views:

- `/activitylog-ui` (primary route)
- `/ActivityLog` (legacy route alias)

### Run Package Tests

[](#run-package-tests)

From this package root:

```
composer install
composer test
```

This runs `phpunit` with `phpunit.xml.dist` config. Tests verify:

- Named routes are registered
- Export route supports GET &amp; POST (for legacy jQuery flow)
- Package views are discoverable

---

⚙️ Configuration Overview
-------------------------

[](#️-configuration-overview)

A full configuration file is published to `config/activitylog-ui.php`. Below is a quick reference:

```
return [
    'route' => [
        'prefix' => 'activitylog-ui', // URL prefix
        'middleware' => null,         // Auto-detected or custom array
    ],

    'authorization' => [
        'enabled' => false,           // true => uses Gate / auth middleware
        'gate'    => 'viewActivityLogUi',
    ],

    'access' => [
        'allowed_users' => [],        // user email whitelist
        'allowed_roles' => [],        // role names (Spatie Permission, etc.)
    ],

    'features' => [
        'analytics'   => true,      // Show analytics dashboard tab
        'exports'     => true,      // Enable data exports
        'saved_views' => true,      // Allow saving filter configurations
    ],

    'exports' => [
        'enabled_formats' => ['csv', 'xlsx', 'pdf', 'json'],
        'max_records'     => 10000, // Max records per export (configurable via ACTIVITYLOG_MAX_EXPORT_RECORDS)
        'queue' => [
            'enabled'   => false,   // Queue exports >1000 records
            'threshold' => 1000,    // Records count threshold for queueing
            'queue_name'=> 'exports',
            'timeout'   => 300,     // 5 minutes
            'tries'     => 3,       // Retry failed exports 3 times
        ],
    ],
];
```

Refer to the inline comments in the file for every available option.

---

🔐 Authorization &amp; Access Control
------------------------------------

[](#-authorization--access-control)

- **Gate:** `viewActivityLogUi` is auto-registered (see `ActivitylogUiServiceProvider`). You may define it in your own code or rely on the package’s default email/role checks.
- **Toggle authentication:** Set `authorization.enabled` to `true` to require login + gate.
- **Granular lists:** `access.allowed_users` and `access.allowed_roles` let you open the UI to a subset of users—regardless of the gate.

---

📤 Exports
---------

[](#-exports)

- **CSV &amp; JSON** work out-of-the-box.
- **Excel (XLSX)** requires `maatwebsite/excel` – otherwise we gracefully fall back to CSV.
- **PDF** requires `barryvdh/laravel-dompdf` – otherwise we fall back to JSON.
- Large exports can be **queued**; enable `exports.queue.enabled`.

---

📈 Analytics Dashboard
---------------------

[](#-analytics-dashboard)

Enable/disable with `features.analytics`. Caches stats for `analytics.cache_duration` seconds (default 1 h).

---

🔧 API Endpoints
---------------

[](#-api-endpoints)

### Main Dashboard

[](#main-dashboard)

- `GET /activitylog-ui/` – Main UI page

### API Routes (JSON)

[](#api-routes-json)

- `GET /activitylog-ui/api/activities` – List activities with filters &amp; pagination
- `GET /activitylog-ui/api/activities/{id}` – Get activity detail
- `GET /activitylog-ui/api/activities/{id}/related` – Related activities by subject
- `GET /activitylog-ui/api/filter-options` – Available filters (events, users, subjects)
- `GET /activitylog-ui/api/event-types-styling` – Event type icons &amp; colors
- `GET /activitylog-ui/api/analytics` – Dashboard stats and charts
- `GET /activitylog-ui/api/analytics/heatmap` – Activity heatmap data
- `GET /activitylog-ui/api/users/{userId}/profile` – User activity profile
- `GET /activitylog-ui/api/recent?hours=1&limit=50` – Recent activities
- `GET /activitylog-ui/api/search/suggestions?q=query` – Search suggestions
- `GET /activitylog-ui/api/views` – Saved filter views
- `POST /activitylog-ui/api/views` – Save a filter view
- `DELETE /activitylog-ui/api/views` – Delete a view
- `GET|POST /activitylog-ui/api/export` – Export activities (supports legacy GET redirect)
- `GET /activitylog-ui/api/export/formats` – Available export formats
- `GET /activitylog-ui/api/export/progress?job_id=xxx` – Queued export progress
- `POST /activitylog-ui/api/export/cleanup` – Cleanup old export files
- `GET /activitylog-ui/export/download?path=base64` – Download exported file

### Legacy Routes (Backward Compatibility)

[](#legacy-routes-backward-compatibility)

- `GET /ActivityLog/` – Main UI (redirects to /activitylog-ui)
- `GET /ActivityLog/api/*` – API endpoints (same as above)

---

🤝 Contributing
--------------

[](#-contributing)

PRs and issues are welcome! Please ensure:

- All tests pass: `composer test`
- Code follows PSR-12 style
- ActivityLogList.blade.php remains unchanged (Bootstrap + jQuery base)

---

📝 License
---------

[](#-license)

The MIT License (MIT). See `LICENSE` for details.

[![Latest Version on Packagist](https://camo.githubusercontent.com/8de1fda0f54d163925352b1bd7d46240ffd9da8c9106fb3833d408be358821f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656b6f79616e7539392f6c61726176656c2d61637469766974796c6f672d75692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ekoyanu99/laravel-activitylog-ui)[![Total Downloads](https://camo.githubusercontent.com/779c5ba8ed9451ec8865f3e46e2b48c3b4bb3f40b2fc8aeec1b73976fdc6d563/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656b6f79616e7539392f6c61726176656c2d61637469766974796c6f672d75692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ekoyanu99/laravel-activitylog-ui)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36530602?v=4)[Eko Yanuarso Budi](/maintainers/ekoyanu99)[@ekoyanu99](https://github.com/ekoyanu99)

---

Top Contributors

[![ekoyanu99](https://avatars.githubusercontent.com/u/36530602?v=4)](https://github.com/ekoyanu99 "ekoyanu99 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ekoyanu99-laravel-activitylog-ui/health.svg)

```
[![Health](https://phpackages.com/badges/ekoyanu99-laravel-activitylog-ui/health.svg)](https://phpackages.com/packages/ekoyanu99-laravel-activitylog-ui)
```

###  Alternatives

[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.8k](/packages/nasirkhan-laravel-starter)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

138249.0k8](/packages/statamic-rad-pack-runway)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21336.4k4](/packages/ecotone-laravel)[nasirkhan/module-manager

Module Manager &amp; Generator for Laravel Starter Kit (https://github.com/nasirkhan/laravel-starter)

1048.5k6](/packages/nasirkhan-module-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
