定制 jalismahamud/traffic-analytics 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jalismahamud/traffic-analytics

最新稳定版本:v3.2.0

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

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固