PHPackages                             syofyanzuhad/lumina-core - 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. [Framework](/categories/framework)
4. /
5. syofyanzuhad/lumina-core

ActiveLibrary[Framework](/categories/framework)

syofyanzuhad/lumina-core
========================

Core models, migrations, and shared logic for Lumina analytics.

v1.0.0(today)00MITPHPPHP ^8.3

Since Aug 9Pushed todayCompare

[ Source](https://github.com/syofyanzuhad/lumina-core)[ Packagist](https://packagist.org/packages/syofyanzuhad/lumina-core)[ RSS](/packages/syofyanzuhad-lumina-core/feed)WikiDiscussions main Synced today

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

Lumina Core Package (`lumina/core`) 📊
=====================================

[](#lumina-core-package-luminacore-)

> Core package for Lumina web analytics. Provides models, migrations, server-side tracking middleware, JS ingestion collector, `AnalyticsService` query engine, and embedded Livewire dashboard components.

---

📦 Installation
--------------

[](#-installation)

Require `lumina/core` via Composer:

```
composer require lumina/core
```

Publish and run migrations:

```
php artisan vendor:publish --tag=lumina-core-migrations
php artisan migrate
```

---

🛠️ Middleware &amp; Tracking
----------------------------

[](#️-middleware--tracking)

### Server-Side Middleware (Path A)

[](#server-side-middleware-path-a)

Track pageviews directly from your host application's HTTP requests:

```
use Lumina\Core\Middleware\TrackPageview;

Route::middleware([TrackPageview::class])->group(function () {
    Route::get('/', [HomeController::class, 'index']);
});
```

### Client-Side JS Script (Path B)

[](#client-side-js-script-path-b)

Include the lightweight `< 2KB` vanilla script tag:

```

```

#### Custom Event Tracking API

[](#custom-event-tracking-api)

```
// Dispatch custom event to /api/collect
window.lumina('event_name', { key: 'value' });
```

---

📈 AnalyticsService Query API
----------------------------

[](#-analyticsservice-query-api)

The `Lumina\Core\Services\AnalyticsService` class provides high-performance cached aggregation queries (60s default TTL):

```
use Lumina\Core\Services\AnalyticsService;

$analytics = app(AnalyticsService::class);

// Dashboard overview payload (Pageviews, Visitors, Referrers, Devices, OS, Browsers, Countries, Goals)
$overview = $analytics->getOverview($site, $start, $end);

// Enhanced Data Detection aggregations
$topBrowsers = $analytics->getTopBrowsers($site, $start, $end, limit: 10);
$topOS = $analytics->getTopOperatingSystems($site, $start, $end, limit: 10);
$topCountries = $analytics->getTopCountries($site, $start, $end, limit: 10);

// Custom Event tracking metrics
$customEvents = $analytics->getCustomEvents($site, $start, $end);
$propertyBreakdown = $analytics->getCustomEventPropertyBreakdown($site, 'signup_completed', 'plan', $start, $end);

// Goal & Conversion calculation
$goals = $analytics->getGoals($site, $start, $end);
```

---

🖼️ Embedded Livewire Component
------------------------------

[](#️-embedded-livewire-component)

Embed the full Lumina analytics dashboard in your Blade layouts:

```

```

---

🧪 Testing Package Core
----------------------

[](#-testing-package-core)

Run package feature tests using Pest:

```
vendor/bin/pest packages/lumina-core/tests/
```

---

📄 License
---------

[](#-license)

MIT License.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1cac985174ded780c6587c27619150114b5ec3bb47ea0bb25696760c1a9fc86?d=identicon)[Syofyan Zuhad](/maintainers/Syofyan%20Zuhad)

---

Top Contributors

[![syofyanzuhad](https://avatars.githubusercontent.com/u/52684582?v=4)](https://github.com/syofyanzuhad "syofyanzuhad (50 commits)")

---

Tags

frameworklaravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/syofyanzuhad-lumina-core/health.svg)

```
[![Health](https://phpackages.com/badges/syofyanzuhad-lumina-core/health.svg)](https://phpackages.com/packages/syofyanzuhad-lumina-core)
```

###  Alternatives

[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

4041.8k](/packages/codewithdennis-larament)[ercogx/laravel-filament-starter-kit

This is a Filament v5 Starter Kit for Laravel 13, designed to accelerate the development of Filament-powered applications.

471.8k](/packages/ercogx-laravel-filament-starter-kit)[nunomaduro/laravel-starter-kit-inertia-react

The skeleton application for the Laravel framework.

2221.2k](/packages/nunomaduro-laravel-starter-kit-inertia-react)

PHPackages © 2026

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