bilfeldt/laravel-route-statistics
Log Laravel requests and responses for route usage statistics, grouped by route with optional hourly, daily, or monthly aggregation to keep database storage minimal. Track per-user and unauthenticated usage.
user_id, team_id, timestamps, and aggregation by minute/hour/day/month) give a defensible answer to "who actually uses this screen?" — turning feature sunset/scale-up debates from opinion into evidence.route:unused command lists every route with zero logged hits, producing a ready-made candidate list for removal. This is the single highest-ROI use of the package for a maturing product: it converts an engineering cleanup backlog into a prioritized, evidence-backed one.team_id context, you can build cohort/activation reporting ("did the account touch the core workflow in week one?") without buying a product-analytics suite or adding client-side tracking.whereApi / whereWeb query scopes plus per-route volumes let you see which endpoints or surfaces tenants lean on — useful for pricing-tier design, overage policy, and deciding whether an integration deserves a dedicated plan.Consider adopting when:
Look elsewhere when:
One line: A small, free, MIT-licensed Laravel package that records which routes our app actually uses, per user and per team, so we can make roadmap, deprecation, and pricing decisions on evidence instead of guesswork — with all data staying in our own database.
For executives — the business case: We currently cannot confidently answer "is anyone using this feature?" or "which parts of the API do our biggest customers depend on?" We can either buy a product-analytics/observability platform (recurring cost, procurement, security review, data leaving our perimeter) or install an open-source package in an afternoon. This gives us the 80% answer — route-level usage, per-user and per-team, over time — for near-zero cost and no vendor. The immediate deliverable is a ranked list of unused routes and features, which is a direct, defensible input to reducing maintenance surface and infrastructure spend.
For engineering — the honest trade-off: Installation is a Composer require, one published migration, and one config file. Enabling is a single line in bootstrap/app.php, a routestatistics route middleware, or an ad-hoc $request->routeStatistics() call inside a controller for conditional cases. It writes one row per request into our own database, with optional aggregation by second/minute/hour/day/month plus a purge path, and supports queued logging so we don't add latency to the hot path. It captures user_id, team_id, method, route, parameters, status, IP, and timestamp — so we own the privacy decision: scoping, IP suppression, and retention are configuration, not vendor terms.
For the risk register: Low lock-in, low switching cost — the logging contract is an interface we can reimplement or replace. The real risks are (1) single-maintainer, zero-dependents project maturity, mitigated by MIT license and a small, readable codebase we can fork if needed; (2) privacy obligations from storing IPs and user IDs, which we address with scoped middleware and a retention job; and (3) it being mistaken for observability tooling — it explicitly is not, and we should say so before someone expects dashboards and alerts.
Recommendation: Adopt in a scoped pilot, not globally. Enable via route middleware on two or three route groups where a real decision is pending (one candidate for deprecation, one high-traffic API surface), pair it with a retention job and an IP-handling decision, and review route:stats / route:unused output after 30 days. Expand only if the data changes a decision.
How can I help you explore Laravel packages today?