PHPackages                             fyz/traffic - 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. fyz/traffic

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

fyz/traffic
===========

Monitor laravel traffic.

31421PHP

Since Aug 15Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/Faiz09/traffic)[ Packagist](https://packagist.org/packages/fyz/traffic)[ RSS](/packages/fyz-traffic/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Traffic
=======

[](#traffic)

A lightweight Laravel monitoring package that provides comprehensive HTTP traffic insights without database overhead.

Overview
--------

[](#overview)

Traffic is a filesystem-based Laravel monitoring solution that captures detailed request analytics, performance metrics, and user insights. Unlike database-driven alternatives, it uses efficient file storage with automatic cleanup, ensuring minimal impact on your application's performance.

Features
--------

[](#features)

- **HTTP Traffic Logging** - Complete request/response monitoring
- **Performance Metrics** - Route-level execution time analysis
- **Flexible Configuration** - Monitor all routes or specific endpoints
- **RESTful API** - Query your analytics data programmatically
- **Zero Database Impact** - Filesystem storage with automatic cleanup
- **Device &amp; User Analytics** - Comprehensive visitor insights

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

[](#installation)

```
composer require fyz/traffic
```

**Optional:** Publish the configuration file to customize settings

```
php artisan vendor:publish --tag=traffic
```

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

[](#configuration)

Configure monitoring behavior in `config/traffic.php`:

- **global**: `true/false` - Monitor all application routes
- **routes**: `true/false` - Enable selective monitoring via middleware

Usage
-----

[](#usage)

### Global Monitoring

[](#global-monitoring)

Set `global: true` in config to monitor all routes automatically.

### Selective Monitoring

[](#selective-monitoring)

Use the `traffic` middleware on specific routes:

```
// Monitor a route group
Route::middleware(['traffic'])->group(function () {
    Route::get('/api/users', [UserController::class, 'index']);
    Route::post('/api/users', [UserController::class, 'store']);
});

// Monitor a single route
Route::get('/dashboard', [DashboardController::class, 'index'])
     ->middleware(['traffic']);
```

Data Access
-----------

[](#data-access)

Access your analytics via RESTful endpoints:

### Today's Data

[](#todays-data)

```
GET|POST /traffic/logs/{resource}
```

### Historical Data

[](#historical-data)

```
GET|POST /traffic/logs/{resource}/since/{days}
```

**Available Resources:**

- `requests` - HTTP request logs
- `performance` - Route execution metrics
- `devices` - Device and browser analytics
- `users` - User behavior insights

Example API Calls
-----------------

[](#example-api-calls)

```
# Get today's requests
curl https://yourapp.com/traffic/logs/requests

# Get performance data from last 7 days
curl https://yourapp.com/traffic/logs/performance/since/7

# Get user analytics from last 30 days
curl https://yourapp.com/traffic/logs/users/since/30
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance41

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/799c00f1c8e9807544313cfa581dfb529031115b0be12ff14f5ff6f8c7c56ee4?d=identicon)[Faiz09](/maintainers/Faiz09)

---

Top Contributors

[![faizzed](https://avatars.githubusercontent.com/u/14324782?v=4)](https://github.com/faizzed "faizzed (33 commits)")

---

Tags

insightslaravellogsperformancephptraffic

### Embed Badge

![Health badge](/badges/fyz-traffic/health.svg)

```
[![Health](https://phpackages.com/badges/fyz-traffic/health.svg)](https://phpackages.com/packages/fyz-traffic)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)

PHPackages © 2026

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