PHPackages                             ibrahim-eng12/trackora - 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. ibrahim-eng12/trackora

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

ibrahim-eng12/trackora
======================

Trackora - A powerful Laravel package to track and analyze website visitors with detailed statistics, browser detection, geolocation, and a beautiful dashboard.

v1.0.0(3mo ago)55MITBladePHP ^8.1

Since Feb 4Pushed 3mo agoCompare

[ Source](https://github.com/ibrahim-eng12/Trackora)[ Packagist](https://packagist.org/packages/ibrahim-eng12/trackora)[ RSS](/packages/ibrahim-eng12-trackora/feed)WikiDiscussions main Synced 1mo ago

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

 [![Trackora](logo.png)](logo.png)

Trackora
========

[](#trackora)

A powerful Laravel package to track and analyze website visitors with detailed statistics, browser detection, geolocation, and a beautiful dashboard with light/dark mode support.

Features
--------

[](#features)

- Track website visitors automatically with middleware
- Browser and platform detection
- Device type detection (Desktop, Mobile, Tablet)
- Geolocation support (country, city)
- Unique visitor tracking per day
- Beautiful responsive dashboard with statistics
- Light/Dark mode toggle with persistent preference
- Export data to CSV or JSON
- Configurable data retention
- Bot/crawler filtering
- API endpoint for statistics

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

[](#requirements)

- PHP 8.1+
- Laravel 10.0+

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

[](#installation)

Install the package via Composer:

```
composer require ibrahim-eng12/trackora
```

Publish the configuration, migration, and asset files:

```
php artisan vendor:publish --tag=trackora-config
php artisan vendor:publish --tag=trackora-migrations
php artisan vendor:publish --tag=trackora-assets
```

Run the migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Automatic Tracking with Middleware

[](#automatic-tracking-with-middleware)

Add the tracking middleware to your routes or middleware groups:

**Option 1: Global middleware (in `bootstrap/app.php` for Laravel 11+):**

```
->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \IbrahimEng12\Trackora\Http\Middleware\TrackVisitor::class,
    ]);
})
```

**Option 2: Route middleware (in `app/Http/Kernel.php` for Laravel 10):**

```
protected $middlewareGroups = [
    'web' => [
        // ... other middleware
        \IbrahimEng12\Trackora\Http\Middleware\TrackVisitor::class,
    ],
];
```

**Option 3: Per-route middleware:**

```
Route::middleware(['trackora.track'])->group(function () {
    // Your routes here
});
```

### Manual Tracking

[](#manual-tracking)

You can also track visitors manually:

```
use IbrahimEng12\Trackora\Models\Visitor;

// Track current request
Visitor::track($request);

// Track with custom page
Visitor::track($request, 'custom-page-name');
```

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

[](#configuration)

After publishing, the configuration file will be available at `config/trackora.php`:

```
return [
    // URL prefix for dashboard (e.g., /trackora)
    'route_prefix' => 'trackora', // You can change the ROUTE for the Trackora dashboard of trackora HERE!
    // Middleware for dashboard routes
    'middleware' => ['web', 'auth'], // here you can add Role middleware like role:admin to allow only admin auth access
    // Users allowed to access dashboard (empty = all authenticated users)
    'allowed_users' => [], // here you can add IDs like 1 OR 1, 2  to allow only these users dashboard access
    // Enable/disable tracking globally
    'enabled' => env('TRACKORA_ENABLED', true),

    // Track authenticated users
    'track_authenticated' => true,

    // Track bots/crawlers
    'track_bots' => false,

    // Paths to exclude from tracking (supports wildcards)
    'excluded_paths' => [
        'admin/*',
        'api/*',
        'livewire/*',
        '_debugbar/*',
    ],

    // IPs to exclude from tracking
    'excluded_ips' => [],

    // Geolocation settings
    'geolocation' => [
        'enabled' => true,
        'provider' => 'ip-api',
    ],

    // Data retention (days, null = forever)
    'retention_days' => 90,

    // Database table name
    'table_name' => 'trackora_visits',

    // Dashboard settings
    'dashboard' => [
        'per_page' => 25,
        'default_period' => 30,
        'chart_colors' => [
            'primary' => '#3b82f6',
            'secondary' => '#10b981',
        ],
    ],
];
```

### Accessing the Dashboard

[](#accessing-the-dashboard)

Visit `/trackora` (or your configured route prefix) to access the dashboard.

### Statistics Methods

[](#statistics-methods)

The `Visitor` model provides several static methods for statistics:

```
use IbrahimEng12\Trackora\Models\Visitor;

// Counts
Visitor::getTotalCount();           // Total visits
Visitor::getUniqueCount();          // Unique visitors
Visitor::getTodayCount();           // Today's visits
Visitor::getTodayUniqueCount();     // Today's unique visitors
Visitor::getCountByDate('2024-01-15');
Visitor::getCountBetweenDates('2024-01-01', '2024-01-31');

// Analytics
Visitor::getTopPages(10);           // Top visited pages
Visitor::getTopBrowsers(10);        // Browser statistics
Visitor::getTopPlatforms(10);       // Platform statistics
Visitor::getDeviceTypeStats();      // Device type breakdown
Visitor::getDailyStats(30);         // Daily stats for N days
Visitor::getTopCountries(10);       // Country statistics
Visitor::getTopCities(10);          // City statistics
Visitor::getTopReferrers(10);       // Referrer statistics

// Maintenance
Visitor::purgeOldRecords();         // Purge based on retention_days config
```

### API Endpoint

[](#api-endpoint)

The package provides a JSON API endpoint at `/trackora/stats`:

```
GET /trackora/stats?period=30
```

Response:

```
{
    "total_visits": 1250,
    "unique_visitors": 850,
    "today_visits": 45,
    "today_unique": 32,
    "daily_stats": [...],
    "top_pages": [...],
    "top_browsers": [...],
    "top_platforms": [...],
    "device_stats": [...],
    "top_countries": [...]
}
```

### Customizing Views

[](#customizing-views)

Publish the views to customize the dashboard:

```
php artisan vendor:publish --tag=trackora-views
```

Views will be published to `resources/views/vendor/trackora/`.

### Publishing Assets

[](#publishing-assets)

If you need to customize the dashboard assets (logo, etc.):

```
php artisan vendor:publish --tag=trackora-assets
```

Assets will be published to `public/vendor/trackora/`.

Restricting Dashboard Access
----------------------------

[](#restricting-dashboard-access)

### By User ID or Email

[](#by-user-id-or-email)

Add specific user IDs or emails to the `allowed_users` config:

```
'allowed_users' => [
    1,                          // User ID
    'admin@example.com',        // Email
],
```

### By Custom Logic

[](#by-custom-logic)

Create your own middleware that extends `AuthorizeTrackoraDashboard`:

```
namespace App\Http\Middleware;

use IbrahimEng12\Trackora\Http\Middleware\AuthorizeTrackoraDashboard;

class CustomTrackoraAuthorization extends AuthorizeTrackoraDashboard
{
    protected function isAuthorized($request): bool
    {
        return $request->user()?->isAdmin();
    }
}
```

Scheduled Cleanup
-----------------

[](#scheduled-cleanup)

To automatically purge old records, add this to your scheduler:

```
// In app/Console/Kernel.php or routes/console.php
Schedule::call(function () {
    \IbrahimEng12\Trackora\Models\Visitor::purgeOldRecords();
})->daily();
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance82

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

95d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05baae4a5e538a69414ac964017d9d79d2550691708f804d1a0de699e53c62e5?d=identicon)[ibrahim-eng12](/maintainers/ibrahim-eng12)

---

Top Contributors

[![ibrahim-eng12](https://avatars.githubusercontent.com/u/126605683?v=4)](https://github.com/ibrahim-eng12 "ibrahim-eng12 (1 commits)")

---

Tags

laravelgeolocationtrackingvisitoranalyticsstatisticsbrowser detectiontrackora

### Embed Badge

![Health badge](/badges/ibrahim-eng12-trackora/health.svg)

```
[![Health](https://phpackages.com/badges/ibrahim-eng12-trackora/health.svg)](https://phpackages.com/packages/ibrahim-eng12-trackora)
```

###  Alternatives

[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[cornford/googlitics

An easy way to integrate Google Analytics with Laravel.

3310.2k](/packages/cornford-googlitics)[adrianorosa/laravel-geolocation

Laravel Geo Location package to get details for a given IP Address

6593.3k1](/packages/adrianorosa-laravel-geolocation)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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