PHPackages                             abdelhamiderrahmouni/pan-laravel-10 - 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. abdelhamiderrahmouni/pan-laravel-10

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

abdelhamiderrahmouni/pan-laravel-10
===================================

\[A fork to support Laravel 10\] A simple, lightweight, and privacy-focused product analytics php package.

v0.1.9(1y ago)026MITPHPPHP ^8.2.0

Since Oct 14Pushed 1y agoCompare

[ Source](https://github.com/abdelhamiderrahmouni/pan-laravel-10)[ Packagist](https://packagist.org/packages/abdelhamiderrahmouni/pan-laravel-10)[ Fund](https://www.paypal.com/paypalme/enunomaduro)[ GitHub Sponsors](https://github.com/iamdavidhill)[ RSS](/packages/abdelhamiderrahmouni-pan-laravel-10/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (11)Used By (0)

 [![Pan](https://raw.githubusercontent.com/abdelhamiderrahmouni/pan-laravel-10/main/docs/banner.png)](https://raw.githubusercontent.com/abdelhamiderrahmouni/pan-laravel-10/main/docs/banner.png)

 [![GitHub Workflow Status (main)](https://github.com/abdelhamiderrahmouni/pan-laravel-10/actions/workflows/tests.yml/badge.svg)](https://github.com/abdelhamiderrahmouni/pan-laravel-10/actions) [![Total Downloads](https://camo.githubusercontent.com/056b91db43dc1748675d8e995d769d07e636cdc8c2a98ccdc3e1641d920887e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616264656c68616d696465727261686d6f756e692f70616e2d6c61726176656c2d3130)](https://packagist.org/packages/abdelhamiderrahmouni/pan-laravel-10) [![Latest Version](https://camo.githubusercontent.com/3f336607180cdb876b718a2bee8a1de1ccb4ec4e5fe2168aea003ab29c0335d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616264656c68616d696465727261686d6f756e692f70616e2d6c61726176656c2d3130)](https://packagist.org/packages/abdelhamiderrahmouni/pan-laravel-10) [![License](https://camo.githubusercontent.com/788aae206d8b3bfd0b5bd09c07aeacba1c7cc57dda443271594cbaec959d9463/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616264656c68616d696465727261686d6f756e692f70616e2d6c61726176656c2d3130)](https://packagist.org/packages/abdelhamiderrahmouni/pan-laravel-10)

---

Warning

This is a fork of [the original package](https://github.com/panphp/pan) that I modified to add support to laravel 10 apps.

**Pan is a lightweight and privacy-focused PHP product analytics library**. It’s designed as a very simple package that you can install via `composer require` and start tracking your pages or components with **a simple `data-pan` attribute**.

At the time of writing, Pan tracks only the following events: impressions, hovers, and clicks. It does not collect any personal information, such as IP addresses, user agents, or any data that could be used to identify a user.

 [![Pan](https://raw.githubusercontent.com/abdelhamiderrahmouni/pan-laravel-10/main/docs/banner-command-with-background.png)](https://raw.githubusercontent.com/abdelhamiderrahmouni/pan-laravel-10/main/docs/banner-command-with-background.png)

**Use cases:**

- you have **different tabs** within a page with the same URL, and you want to know **which one is the most viewed**. By adding the `data-pan` attribute to your tabs, you can track this information.
- you have **different register buttons** in your application, and you want to know **which one is the most clicked**. By adding the `data-pan` attribute to your buttons, you can track this information.
- you have different "help" pop-hovers in your application, and you want to know **which one is the most hovered**. By adding the `data-pan` attribute to your pop-hovers, you can track this information.
- and so on...

It works out-of-the-box with your favorite Laravel stack; updating a button color in your "react" won't trigger a new impression, but seeing that same button in a different [Inertia](https://inertiajs.com) page will. Using [Livewire](https://livewire.laravel.com)? No problem, Pan works seamlessly with it too.

Visualize your analytics is as simple as typing `php artisan pan` in your terminal. This command will show you a table with the different analytics you've been tracking, and hopefully, you can use this information to improve your application.

Get Started
-----------

[](#get-started)

> **Requires [PHP 8.3+](https://php.net/releases/), and [Laravel 11.0+](https://laravel.com)**.

You may use [Composer](https://getcomposer.org) to require Pan into your PHP project:

```
composer require abdelhamiderrahmouni/pan-laravel-10
```

After, you may install Pan into your Laravel project using the following command:

```
php artisan install:pan
```

Finally, you may start tracking your pages or components adding the `data-pan` attribute to your HTML elements:

```

-    Tab 1
+    Tab 1
-    Tab 2
+    Tab 2

```

Important

Event names must only contain letters, numbers, dashes, and underscores.

Visualize your product analytics
--------------------------------

[](#visualize-your-product-analytics)

To visualize your product analytics, you may use the `pan` Artisan command:

```
php artisan pan
php artisan pan --filter=tab-profile
```

Whitelist your product analytics
--------------------------------

[](#whitelist-your-product-analytics)

By default, Pan tracks all the HTML elements with the `data-pan` attribute, so bad actors could alter your HTML and create unwanted analytics records in your database. To mitigate this, by default, Pan only allows 50 analytics records to be created.

For extra protection, you may use the `PanConfiguration::allowedAnalytics` method to whitelist the analytics you want to track. This way, only the analytics you've whitelisted will be stored in your database.

```
use Pan\PanConfiguration;

public function register(): void
{
    PanConfiguration::allowedAnalytics([
        'tab-profile',
        'tab-settings',
    ]);
}
```

Alternatively, if you want to allow dynamic analytics, you may use the `PanConfiguration::maxAnalytics` method and this way at least limit the number of analytics records created:

```
PanConfiguration::maxAnalytics(10000);
```

If you want to have unlimited analytics records, you may use the `Pan::unlimitedAnalytics` method:

```
PanConfiguration::unlimitedAnalytics();
```

Configure the route prefix
--------------------------

[](#configure-the-route-prefix)

By default, Pan's route prefix is `/pan`, but you may change it by using the `PanConfiguration::routePrefix` method:

```
PanConfiguration::routePrefix('internal-analytics');
```

With that set the url to track the analytics will be `/internal-analytics/events`.

Flush your product analytics
----------------------------

[](#flush-your-product-analytics)

To flush your product analytics, you may use the `pan:flush` Artisan command:

```
php artisan pan:flush
```

How does it work?
-----------------

[](#how-does-it-work)

Via middleware, Pan injects a simple JavaScript library into your HTML pages. This library listens to events like `viewed`, `clicked`, or `hovered` and sends the data to your Laravel application. Note that this library does not collect any personal information; such as IP addresses, user agents, or any information that could be used to identify a user.

Also on the client-side, these events are collected in a very performant way and batched together to reduce the number of requests to your server.

On the server-side, Pan only stores: the analytic name, and a counter of how many times the different events were triggered. Via the `pan` Artisan command, you may visualize this data, and hopefully use this information to improve your application.

License
-------

[](#license)

Pan is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% 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 ~6 days

Recently: every ~14 days

Total

10

Last Release

516d ago

PHP version history (2 changes)v0.1.1PHP ^8.3.0

v0.1.0PHP ^8.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/745a0575996f5a3dcb6b8e177e5f37e610d83906028a1e99aa2ec3213a281027?d=identicon)[abdelhamiderrahmouni](/maintainers/abdelhamiderrahmouni)

---

Top Contributors

[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (88 commits)")[![iamdavidhill](https://avatars.githubusercontent.com/u/1879069?v=4)](https://github.com/iamdavidhill "iamdavidhill (12 commits)")[![abdelhamiderrahmouni](https://avatars.githubusercontent.com/u/26693672?v=4)](https://github.com/abdelhamiderrahmouni "abdelhamiderrahmouni (6 commits)")[![ryangjchandler](https://avatars.githubusercontent.com/u/41837763?v=4)](https://github.com/ryangjchandler "ryangjchandler (4 commits)")[![xiCO2k](https://avatars.githubusercontent.com/u/823088?v=4)](https://github.com/xiCO2k "xiCO2k (2 commits)")[![austincarpenter](https://avatars.githubusercontent.com/u/3736774?v=4)](https://github.com/austincarpenter "austincarpenter (2 commits)")[![bhaidar](https://avatars.githubusercontent.com/u/1163421?v=4)](https://github.com/bhaidar "bhaidar (2 commits)")[![pristavu](https://avatars.githubusercontent.com/u/4123729?v=4)](https://github.com/pristavu "pristavu (1 commits)")[![pxpm](https://avatars.githubusercontent.com/u/7188159?v=4)](https://github.com/pxpm "pxpm (1 commits)")[![msamgan](https://avatars.githubusercontent.com/u/29948727?v=4)](https://github.com/msamgan "msamgan (1 commits)")[![jbrooksuk](https://avatars.githubusercontent.com/u/246103?v=4)](https://github.com/jbrooksuk "jbrooksuk (1 commits)")

---

Tags

phplaravellibraryanalyticspan

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/abdelhamiderrahmouni-pan-laravel-10/health.svg)

```
[![Health](https://phpackages.com/badges/abdelhamiderrahmouni-pan-laravel-10/health.svg)](https://phpackages.com/packages/abdelhamiderrahmouni-pan-laravel-10)
```

###  Alternatives

[panphp/pan

A simple, lightweight, and privacy-focused product analytics php package.

1.2k94.6k5](/packages/panphp-pan)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[jasonlam604/stringizer

Stringizer is a PHP string manipulation library with support for method chaining and multibyte handling

35110.5k1](/packages/jasonlam604-stringizer)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)

PHPackages © 2026

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