jalismahamud/traffic-analytics 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jalismahamud/traffic-analytics

Composer 安装命令:

composer require jalismahamud/traffic-analytics

包简介

A Laravel package for traffic and activity logging with analytics dashboard

README 文档

README

Latest Version Total Downloads Laravel PHP License

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

Traffic Analytics Dashboard

Dashboard Overview — Dark Mode

Dark Mode Dashboard

Top Visited URLs & HTTP Methods

Top URLs and HTTP Methods

Top URLs Table

Top URLs Table

Recent Requests & Top IPs

Recent Requests

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:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/my-feature
  5. 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 我们能提供哪些服务?
定制开发 / 二次开发

基于 jalismahamud/traffic-analytics 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 32
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-08