PHPackages                             kholil/filament-analitik - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kholil/filament-analitik

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kholil/filament-analitik
========================

Simple page analytics for Filament v4/v5

v1.0.2(1mo ago)05MITPHPPHP ^8.2

Since May 28Pushed 1mo agoCompare

[ Source](https://github.com/amdkholil/filament-analitik)[ Packagist](https://packagist.org/packages/kholil/filament-analitik)[ RSS](/packages/kholil-filament-analitik/feed)WikiDiscussions main Synced 1w ago

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

Filament Analitik
=================

[](#filament-analitik)

[![Latest Version on Packagist](https://camo.githubusercontent.com/21b1bdd8c100d18f3478ccde1bf252a27fb7f130a436dfc72a60fca91a70ec03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b686f6c696c2f66696c616d656e742d616e616c6974696b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kholil/filament-analitik)[![Total Downloads](https://camo.githubusercontent.com/8cba84b9b419780eeebe302bb471b08b6e3a14fb925d9190da2309d38798322e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b686f6c696c2f66696c616d656e742d616e616c6974696b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kholil/filament-analitik)

Simple and lightweight page analytics plugin for Filament v4/v5. Track your website visitors, their location, and page views directly from your Filament dashboard.

**A simple, free, and privacy-friendly alternative to Google Analytics.** No complex setup, no external scripts, and no tracking cookies required. Just install and start tracking your website traffic instantly.

Features
--------

[](#features)

- 🚀 **Asynchronous Tracking**: Uses Laravel Jobs to ensure zero performance impact on your application.
- 📍 **Location Tracking**: Automatically detects city, state, and country using [stevebauman/location](https://github.com/stevebauman/location).
- 📊 **Dashboard Widgets**: Includes stats overview and page views chart widgets.
- 📋 **Resource View**: Manage and view detailed analytics logs in your Filament panel.
- 🛡️ **Privacy Focused**: Excludes Filament panel pages from tracking by default.

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

[](#installation)

You can install the package via composer:

```
composer require kholil/filament-analitik
```

You **must** publish and run the migrations (autoloading from vendor is not supported):

```
php artisan vendor:publish --tag="filament-analitik-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-analitik-config"
```

Usage
-----

[](#usage)

### 1. Register the Plugin

[](#1-register-the-plugin)

Add the plugin to your Filament Panel provider:

```
use Kholil\FilamentAnalitik\FilamentAnalitikPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentAnalitikPlugin::make(),
        ]);
}
```

### 2. Enable Tracking

[](#2-enable-tracking)

To start tracking page views, you must add the `TrackPageView` middleware to your web routes.

#### Laravel 12+ (bootstrap/app.php)

[](#laravel-12-bootstrapappphp)

```
->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \Kholil\FilamentAnalitik\Http\Middleware\TrackPageView::class,
    ]);
})
```

#### Middleware Logic

[](#middleware-logic)

The middleware will:

- Only track `GET` requests with a `200` status code.
- Automatically exclude any requests within the Filament admin panel.
- Dispatch a background job to handle the database insertion and location lookup.

Configuration
-------------

[](#configuration)

The configuration file (`config/filament-analitik.php`) allows you to customize the following settings:

- **enabled**: Enable or disable page view tracking.
- **table\_name**: Change the database table name used to store page views (default: `'filament_page_views'`).
- **project\_id**: A unique identifier for this project. Useful for multi-tenant, SaaS, or centralized analytics setups where you collect analytics from multiple applications or websites into a single database.
    - You can configure this easily in your `.env` file: `FILAMENT_ANALITIK_PROJECT_ID="your-project-id"`
- **navigation**: Customize the sidebar navigation settings:
    - **label**: The text label displayed in the Filament sidebar (default: `'Analitik'`).
    - **group**: The navigation group in the sidebar (default: `null` / no group).
    - **icon**: The icon used in the sidebar (default: `'heroicon-o-chart-bar'`).

Alternatively, you can also customize the sidebar navigation fluently when registering the plugin in your Panel Provider:

```
FilamentAnalitikPlugin::make()
    ->navigationLabel('My Custom Analytics')
    ->navigationGroup('System Reports')
    ->navigationIcon('heroicon-o-presentation-chart-line')
```

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

[](#authorization--access-control)

You can restrict access to the analytics dashboard and logs in three different ways:

### 1. Gate-Based Permissions

[](#1-gate-based-permissions)

Define a Laravel Gate or Permission name (e.g. using Spatie Laravel-Permission) in your `config/filament-analitik.php` file:

```
'access' => [
    'gate' => 'view_analytics_logs',
],
```

### 2. Role-Based Access

[](#2-role-based-access)

Define an array of roles that are allowed to access:

```
'access' => [
    'roles' => ['admin', 'super-admin'],
],
```

*Note: The plugin automatically integrates with package role methods such as `$user->hasAnyRole($roles)` or `$user->hasRole($role)` and falls back to checking a direct `$user->role` property.*

### 3. Custom Fluent Callback

[](#3-custom-fluent-callback)

For custom or complex programmatic authorization logic, pass a Closure dynamically to the plugin registration in your Panel Provider:

```
FilamentAnalitikPlugin::make()
    ->canAccessUsing(fn () => auth()->user()->email === 'kholil@example.com')
```

Documentation
-------------

[](#documentation)

Detailed technical documentation and requirements can be found in the [doc](doc) folder:

- [Software Requirements Specification (SRS)](doc/SRS.md)

Requirements
------------

[](#requirements)

- PHP 8.2+
- Filament v4.0+ / v5.0+
- Laravel 11.0+ / 12.0+

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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 ~3 days

Total

3

Last Release

52d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29882551?v=4)[Ahmad Kholil](/maintainers/amdkholil)[@amdkholil](https://github.com/amdkholil)

---

Top Contributors

[![amdkholil](https://avatars.githubusercontent.com/u/29882551?v=4)](https://github.com/amdkholil "amdkholil (11 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/kholil-filament-analitik/health.svg)

```
[![Health](https://phpackages.com/badges/kholil-filament-analitik/health.svg)](https://phpackages.com/packages/kholil-filament-analitik)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.8k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[tapp/filament-lms

193.5k](/packages/tapp-filament-lms)[daacreators/creators-ticketing

A robust and dynamic ticketing system for Filament

293.8k](/packages/daacreators-creators-ticketing)[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

284.8k2](/packages/finity-labs-fin-mail)[tapp/filament-form-builder

User facing form builder using Filament components

132.4k5](/packages/tapp-filament-form-builder)

PHPackages © 2026

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