jalismahamud/traffic-analytics
Composer 安装命令:
composer require jalismahamud/traffic-analytics
包简介
A Laravel package for traffic and activity logging with analytics dashboard
README 文档
README
Laravel Traffic Analytics
A powerful, plug-and-play Laravel package for tracking, analyzing, and visualizing your application's HTTP traffic — with a beautiful real-time dashboard, dark mode, CSV export, and zero configuration required.
Features
- Automatic HTTP Traffic Logging via middleware — zero manual code needed
- Beautiful Analytics Dashboard with real-time charts (Chart.js)
- Dark Mode support with toggle
- Flexible Date Filtering — Today, Last 7 Days, Last 30 Days, Custom Range
- Traffic Over Time line chart with Avg Response Time overlay
- Status Code Distribution doughnut chart (2xx / 3xx / 4xx / 5xx)
- Top Visited URLs with popularity bar chart
- HTTP Method Distribution pie chart (GET / POST / PUT / DELETE)
- Top IP Addresses with hit count
- Recent Requests live log table
- CSV Export for any date range
- Auto-refresh every 15 seconds
- Response Caching for high-traffic sites
Screenshots
Dashboard Overview — Light Mode
Dashboard Overview — Dark Mode
Top Visited URLs & HTTP Methods
Top URLs Table
Recent Requests & Top IPs
Installation
Step 1 — Install via Composer
composer require jalismahamud/traffic-analytics
Step 2 — Publish Config & Run Migration
php artisan vendor:publish --tag=traffic-analytics-config php artisan migrate
Done!
Visit your dashboard at:
/admin/traffic
The middleware registers automatically. No extra route or kernel changes needed.
Configuration (Optional)
Publish the config file to customize behavior:
php artisan vendor:publish --tag=traffic-analytics-config
Dashboard Sections
| Section | Description |
|---|---|
| Metric Cards | Total requests, unique visitors, avg response time, error rate, today's stats |
| Traffic Over Time | Line chart showing request volume and avg response time per hour/day |
| Status Distribution | Doughnut chart — 2xx success, 3xx redirects, 4xx client errors, 5xx server errors |
| Top Visited URLs | Horizontal bar chart of most-hit endpoints |
| HTTP Methods | Pie chart breakdown of GET, POST, PUT, PATCH, DELETE |
| Top URLs Table | Tabular view with hits, avg response time, and popularity bar |
| Recent Requests | Live scrollable log of latest requests with method, status, IP, timing |
| Top IP Addresses | Most active IPs with request count and visual bar |
Database Schema
The package creates a single traffic_logs table:
| Column | Type | Description |
|---|---|---|
id |
bigint |
Auto-increment primary key |
url |
text |
Full request URL |
method |
varchar(10) |
HTTP method (GET, POST, etc.) |
ip_address |
varchar(45) |
Client IP (supports IPv6) |
status_code |
smallint |
HTTP response status code |
response_time |
float |
Response time in milliseconds |
user_id |
bigint |
Authenticated user ID (nullable) |
user_agent |
text |
Browser user agent string |
referrer |
text |
HTTP referrer header |
created_at |
timestamp |
When the request was logged |
Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.1 |
| Laravel | ^10.0 | ^11.0 | ^12.0 |
| Database | MySQL / MariaDB (uses DATE_FORMAT) |
Uninstalling
php artisan migrate:rollback --path=vendor/jalismahamud/traffic-analytics/database/migrations composer remove jalismahamud/traffic-analytics
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/my-feature - Open a Pull Request
License
This package is open-source software licensed under the MIT License.
Made with ❤️ for the Laravel community
jalismahamud/traffic-analytics 适用场景与选型建议
jalismahamud/traffic-analytics 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「logging」 「analytics」 「traffic」 「laravel」 「activity-log」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jalismahamud/traffic-analytics 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jalismahamud/traffic-analytics 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jalismahamud/traffic-analytics 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Zend Framework module that sets up Monolog for logging in applications.
Lightweight traffic tracking for CodeIgniter 4
Asynchronous Sentry for Symfony - Fire and forget
Analytics chooser extensions for site settings.
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
High-performance, zero-dependency PSR-3 logger for MonkeysLegion with structured logging, handlers, processors, and PHP 8.4 features.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 32
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-08




