PHPackages                             obd/logtracker - 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. [Caching](/categories/caching)
4. /
5. obd/logtracker

ActivePackage[Caching](/categories/caching)

obd/logtracker
==============

User activity log manager. All kind of database activity will be tracked

v1.1.9(2mo ago)244MITJavaScript

Since Dec 15Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/RonyKader/logtracker)[ Packagist](https://packagist.org/packages/obd/logtracker)[ RSS](/packages/obd-logtracker/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (14)Used By (0)

Logtracker - Modern Audit Logging for Laravel
=============================================

[](#logtracker---modern-audit-logging-for-laravel)

A high-performance, internationalized activity log manager for Laravel applications. This package tracks all database activities and provides a premium, animated audit panel.

Features
--------

[](#features)

- **Premium UI**: Glassmorphic, React-powered dashboard with **30-Day Activity Heatmaps** and interactive **Date Range Picker**.
- **Log Management**: Full-featured **System Log Viewer** with support for multiple files (daily logs), entry deletion, and bulk clearing.
- **Universal SPA**: Works in full-stack Laravel apps, API-only backends, and even as a standalone UI hosted separately.
- **i18n Ready**: Full support for English and Bengali locales.
- **Granular Security**: Access control via User ID whitelisting.
- **Performance**: Asynchronous logging support via Laravel Queues and **Optimized Batch Pruning**.
- **NoSQL Backup**: Background synchronization of logs to MongoDB.
- **Privacy**: Automatically masks sensitive `$hidden` attributes.

---

Installation
------------

[](#installation)

### Option A: Full-Stack Laravel Project (Blade + Auth)

[](#option-a-full-stack-laravel-project-blade--auth)

For projects like `mofa-education` where Laravel handles both frontend and backend.

#### 1. Add the Package

[](#1-add-the-package)

**Local Development:**

```
// composer.json
"repositories": [
    { "type": "path", "url": "./Packages/logtracker" }
]
```

```
composer require obd/logtracker:dev-dev
```

**Production (via GitHub/Packagist):**

```
composer require obd/logtracker
```

#### 2. Publish &amp; Migrate

[](#2-publish--migrate)

```
php artisan vendor:publish --tag=logtracker-config
php artisan vendor:publish --tag=logtracker-assets --force
php artisan migrate
```

#### 3. Add Trait to Models

[](#3-add-trait-to-models)

Automatically add the tracking trait to all your models:

```
php artisan logtracker:install-trait
```

*Alternatively, manually add to specific models:*

```
use Obd\Logtracker\Traits\Logtrackerable;

class Project extends Model {
    use Logtrackerable;
}
```

#### 4. Configure `.env`

[](#4-configure-env)

```
LOGTRACKER_ALLOWED_IDS=1,2,5
```

#### 5. Access

[](#5-access)

Visit `/audit-panel` in your browser. Done!

---

### Option B: API-Only Laravel Project (Sanctum / No Blade Auth)

[](#option-b-api-only-laravel-project-sanctum--no-blade-auth)

For projects like `e-ticketing-api` where Laravel serves only APIs and has no web login route.

#### 1. Add the Package

[](#1-add-the-package-1)

```
// composer.json
"repositories": [
    { "type": "path", "url": "../Packages/logtracker" }
],
"minimum-stability": "dev",
"prefer-stable": true
```

```
composer require obd/logtracker:dev-dev
```

#### 2. Publish &amp; Migrate

[](#2-publish--migrate-1)

```
php artisan vendor:publish --tag=logtracker-config
php artisan vendor:publish --tag=logtracker-assets --force
php artisan migrate
```

#### 3. Configure Middleware &amp; Security (Critical!)

[](#3-configure-middleware--security-critical)

Open `config/obd_tracker.php` and configure for API use:

```
'ui_middleware'  => ['web'],        // Remove 'auth' to prevent 'login route not found'
'api_middleware' => ['web'],
'access_secret'  => env('LOGTRACKER_ACCESS_SECRET'), // Use this to secure the panel
```

#### 4. Add Trait &amp; Configure .env

[](#4-add-trait--configure-env)

```
php artisan logtracker:install-trait
```

```
# .env
LOGTRACKER_ACCESS_SECRET=your-secure-random-key
```

#### 5. Access

[](#5-access-1)

Visit `http://your-api.test/audit-panel` and enter your secret key, or go directly to `http://your-api.test/audit-panel?secret=your-secure-random-key`.

---

### Option C: Standalone / Headless Mode

[](#option-c-standalone--headless-mode)

Host the Logtracker UI on a completely separate domain (e.g., `audit.example.com`) and connect it to any Laravel backend.

#### 1. Install the package on your Laravel backend (Option A or B above).

[](#1-install-the-package-on-your-laravel-backend-option-a-or-b-above)

#### 2. Export Assets

[](#2-export-assets)

Copy the `dist/` folder from the package to your static server or CDN.

#### 3. Create a Mount Page

[](#3-create-a-mount-page)

```
>

        window.LOGTRACKER_API_URL = "https://api.yourbackend.com/audit-panel/ui-config";

```

#### 4. Enable CORS

[](#4-enable-cors)

Ensure your Laravel `config/cors.php` allows requests from the standalone UI domain.

---

Configuration (`config/obd_tracker.php`)
----------------------------------------

[](#configuration-configobd_trackerphp)

KeyDefaultDescription`route_prefix``audit-panel`URL prefix for the UI panel`api_prefix``api/audit-panel-data`URL prefix for the data API`ui_middleware``['web', 'auth']`Middleware for UI routes`api_middleware``['web', 'auth']`Middleware for API routes`allowed_user_ids``[]`Comma-separated User IDs allowed to access the panel (empty = all)`queue_enabled``false`Dispatch logging to a background queue`queue_name``default`Queue connection name`access_secret``null`Secret key for non-auth projects (prevents public access)`retention_days``90`Days to keep logs before pruning### Environment Variables

[](#environment-variables)

```
# Authorization
LOGTRACKER_ALLOWED_IDS=1,2,5
LOGTRACKER_ACCESS_SECRET=your-secret-key-gate

# Performance
LOGTRACKER_QUEUE_ENABLED=true

# MongoDB Sync
LOGTRACKER_MONGO_ENABLED=true
LOGTRACKER_MONGO_CONNECTION=mongodb

# Data Retention
LOGTRACKER_RETENTION_DAYS=90
```

---

Commands
--------

[](#commands)

CommandDescription`logtracker:install-trait`Automatically add audit trait to all Eloquent models`logtracker:install-trait --dry-run`Preview which models would be updated`logtracker:install-trait --dir=app/Models`Specify a custom scan directory`logtracker:prune`Remove logs older than retention period`logtracker:prune --days=30`Override default retention`logtracker:sync-mongo`Mirror logs to MongoDB### Automated Maintenance

[](#automated-maintenance)

```
$schedule->command('logtracker:prune')->daily();
```

---

Updating
--------

[](#updating)

When updating to a new version, always run:

```
composer update obd/logtracker
php artisan vendor:publish --tag=logtracker-assets --force
php artisan optimize:clear
```

---

Security
--------

[](#security)

- **Path Traversal Protection**: System log viewer uses `basename()` + `realpath()` validation to prevent directory traversal attacks.
- **Extension Enforcement**: Only `.log` files can be accessed through the system log viewer.
- **User Whitelisting**: Access can be restricted to specific user IDs via environment configuration.
- **Privacy**: Model `$hidden` attributes (e.g., passwords) are automatically excluded from audit logs.
- **CSRF Protection**: All POST routes (clear/delete) are protected by Laravel's CSRF middleware.

---

*© 2026 Logtracker Audit System - Premium Enterprise Edition*

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance87

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Every ~144 days

Recently: every ~0 days

Total

12

Last Release

72d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8412631?v=4)[w3zones](/maintainers/w3zones)[@w3zones](https://github.com/w3zones)

---

Top Contributors

[![ronykader](https://avatars.githubusercontent.com/u/8412614?v=4)](https://github.com/ronykader "ronykader (17 commits)")

---

Tags

bootstrap5laravelmysqlredis

### Embed Badge

![Health badge](/badges/obd-logtracker/health.svg)

```
[![Health](https://phpackages.com/badges/obd-logtracker/health.svg)](https://phpackages.com/packages/obd-logtracker)
```

###  Alternatives

[beryllium/cachebundle

Provides an interface to Memcache for Symfony2 applications

33136.2k](/packages/beryllium-cachebundle)

PHPackages © 2026

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