PHPackages                             otifsolutions/laravel-tracker - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. otifsolutions/laravel-tracker

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

otifsolutions/laravel-tracker
=============================

The Package will track users activity and generate the complete log in database tables

013PHP

Since Jul 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/otifsolutions/laravel-tracker)[ Packagist](https://packagist.org/packages/otifsolutions/laravel-tracker)[ RSS](/packages/otifsolutions-laravel-tracker/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel-tracker
---------------

[](#laravel-tracker)

The Package will track users activity and generate the complete log in database tables

### Requirements

[](#requirements)

`php >= 7.4`

`laravel >= 8.0`

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

[](#installation)

[**Composer**](https://getcomposer.org/download/) recommended to install package

```
 composer require otifsolutions/laravel-tracker
```

Now put these middlewares at the end of `App\Http\Kernel` route middlware group **web** stack *(order of middlewares is important)*

```
\OTIFSolutions\LaravelTracker\Http\Middleware\TrackActivities::class
```

### Or

[](#or)

If you want your certain group of routes to be tracked, apply the middleware to the route group in **web.php** like

```
use OTIFSolutions\LaravelTracker\Http\Middleware\TrackActivities;

Route::middleware([TrackActivities::class])->group(static function () {
    // your routes to be tracked
});
```

and then run migrations by

```
php artisan migrate

```

### Defaults

[](#defaults)

The package is enabled by default, once it is installed, it will start logging/tracking your site visits into database tables. To check what default settings are, see [**OTIFSolutions\\LaravelTracker\\Traits\\UtilityMethods**](https://github.com/otifsolutions/laravel-tracker/blob/main/src/Traits/UtilityMethods.php) class constructor

```
$this->trackerStatus = Setting::get('tracker_status') ?: true;
$this->trackCookies = Setting::get('track_cookies') ?: false;
$this->trackMiscData = Setting::get('track_misc_data') ?: false;
$this->trackHttpRequests = Setting::get('track_http_requests') ?: true;
```

**Remember** ( If key `tracker_status` is `false` then no other key will work and won't track anything )

Package made database table hold records of certain days, and removes the rest of the data, by default it is set to `20` days, you can either change this too by

```
\OTIFSolutions\Laravel\Settings\Models\Setting::set('keep_except', $numDays);
```

### Set your own keys

[](#set-your-own-keys)

You can use your keys and values using `laravel tinker` **`(php artisan tinker)`** by setting `keyName` and `value`, here are the keys `track_cookies`, `tracker_status`, `track_misc_data`, `track_http_requests`, these keys hold `boolean` values only, so remember to add third parameter as *'bool'*

```
\OTIFSolutions\Laravel\Settings\Models\Setting::set('your_key', $trueFalse, 'bool');
```

### Clearing old data

[](#clearing-old-data)

Data is generated on every page hit by user, at the end we have bulk of data, we have command to remove that data data, which is sheduled to be executed after 30 days at `08::00 AM` and time will be started when package will be installed, though we can run this command manually anytime to remove the data (before set days, default is 20)

```
php artisan clear:records

```

### Note

[](#note)

In **Linux** environments, sometimes, when you install a package, it wants some permissions for package to work, like *laravel.log* and *storage* etc residing in laravel project. You have to grant it permissions by running this command inside your laravel proejct , *for debian based linux distros like Ubuntu*

**for all files in project**

```
sudo chmod -R 0777 *

```

**for certain single file**

```
sudo chmod -R 0777 file

```

where *file* is *absolute path* to the file

### Relationships defined between Models

[](#relationships-defined-between-models)

**UserSession** is the parent model. It has *one-to-many* relation with **UserActivity**, *one-to-many* relation with **RequestData**, *one-to-many* relation with **MyCookie**and *one-to-many* relation with **MiscData**.

### Licence

[](#licence)

The MIT License (MIT). Please see [**License file**](https://github.com/otifsolutions/laravel-tracker/blob/main/LICENSE) for more information

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 99.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f9aeabc454ee05b530e6234f1689a89e8f63bc766e647ad78bec54add4215b4?d=identicon)[otifsolutions](/maintainers/otifsolutions)

---

Top Contributors

[![danish9811](https://avatars.githubusercontent.com/u/100212323?v=4)](https://github.com/danish9811 "danish9811 (139 commits)")[![junaidmaqbutt](https://avatars.githubusercontent.com/u/13379343?v=4)](https://github.com/junaidmaqbutt "junaidmaqbutt (1 commits)")

### Embed Badge

![Health badge](/badges/otifsolutions-laravel-tracker/health.svg)

```
[![Health](https://phpackages.com/badges/otifsolutions-laravel-tracker/health.svg)](https://phpackages.com/packages/otifsolutions-laravel-tracker)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.4k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M274](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M338](/packages/open-telemetry-sdk)

PHPackages © 2026

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