承接 roky/laravel-route-analytics 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

roky/laravel-route-analytics

Composer 安装命令:

composer require roky/laravel-route-analytics

包简介

Dead-simple route usage tracking for Laravel — find unused and slow routes in minutes.

README 文档

README

Dead-simple route usage tracking for Laravel — find unused and slow routes in minutes.

Features

  • 🚀 Zero configuration - Works out of the box
  • 📊 Beautiful dashboard - Clean, responsive UI with filtering and sorting
  • 🔍 Find unused routes - Identify routes that are never hit
  • Track performance - Monitor average and max response times
  • 🛠️ CLI commands - Automate reporting and maintenance
  • 💾 Minimal overhead - Lightweight database storage with atomic updates

Installation

composer require roky/laravel-route-analytics
php artisan migrate

That's it! Visit /route-analytics to see your dashboard.

Dashboard

Access the analytics dashboard at /route-analytics:

  • Overview stats: Tracked routes, total hits, unused routes
  • Sortable table: Click column headers to sort
  • Filters: All, Unused, Slow (>200ms)
  • Real-time data: Automatically updates as traffic flows

CLI Commands

View top routes

php artisan route:analytics:report

Find unused routes

php artisan route:analytics:report --unused

Find slow routes

php artisan route:analytics:report --slow=200

Clear all data

php artisan route:analytics:flush

Prune old data

php artisan route:analytics:prune --days=90

Configuration

Publish the configuration file:

php artisan vendor:publish --tag=route-analytics-config

Available options in config/route-analytics.php:

return [
    'enabled' => true,                  // Enable/disable tracking
    'driver' => 'database',             // Storage driver
    'table' => 'route_analytics',       // Database table name
    'middleware' => ['web'],            // Dashboard middleware
    'path' => 'route-analytics',        // Dashboard path
];

Protect the Dashboard

Add authentication to the dashboard:

'middleware' => ['web', 'auth'],

How It Works

  1. Middleware intercepts every request and records route key, duration, and timestamp
  2. Data is aggregated in the database (hits, average/max/min times)
  3. Dashboard and CLI commands read from the aggregated data
  4. Minimal performance impact - single atomic DB write per request

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固