symplify/symfony-route-usage
Symplify Symfony Route Usage helps identify unused routes in Symfony applications by scanning code and templates for route references. Use it to audit routing configs, remove dead endpoints, and keep route definitions clean and maintainable.
Headline finding: this is not a Laravel package. symplify/symfony-route-usage targets Symfony's symfony/routing component and its kernel event system. Laravel ships its own router (Illuminate\Routing\Router / RouteCollection) and a middleware pipeline; it consumes several Symfony components (HttpFoundation, Console, Process) but not symfony/routing as its dispatcher. There is no adapter, service provider, or configuration surface for Laravel in this codebase. Treat the name as a category signal ("route usage instrumentation"), not an installable dependency.
Architecture fit
kernel.request / console events) that records which routes fire, then diffs the recorded set against the full RouteCollection to surface unused routes.terminate middleware, Route::getRoutes(), and Route::matched() via the router's event dispatcher. The concept transfers cleanly; the code does not. Expect a near-total rewrite of the listener layer, with only the reporting/diff logic being portable.Integration feasibility
Technical risk — HIGH
deprecated-packages; upstream has explicitly retired it. No security patching, no PHP 8.3/8.4 forward compatibility guarantees, no Symfony 7 or Laravel 11+ support commitment.composer.json, forcing dependency-resolution hacks (--ignore-platform-reqs, version aliasing) that we would then have to support.Key questions for the business owner
Stack fit: Not compatible as-is. The package assumes Symfony's dispatcher and route collection; Laravel's equivalents are structurally similar but API-incompatible. No namespace, config, or container binding overlaps.
Recommended path — build thin, borrow the idea:
Route::getRoutes() at boot; persist route name, URI, method, action, and middleware to a manifest table or JSON artifact.terminate middleware (or a Route::matched() listener) that records route name + method + timestamp into a write-buffered store. Prefer a queued/aggregated write over per-request DB inserts.Migration path / compatibility: No migration required because there is nothing to migrate from. If a Symfony service later needs parity, the same manifest-and-diff contract can be reimplemented against Symfony's RouterInterface — the data model, not the code, is the reusable asset.
Sequencing: Build the manifest first (valuable standalone as route inventory), then instrumentation, then reporting. Do not block on the reporting UX; route inventory alone typically exposes dead endpoints by inspection.
Alternatives to evaluate before building: framework-level request logging already captured by APM/observability tooling; Laravel Pulse (if already deployed) for request-level visibility; static analysis of route references in views/controllers for the "is this route referenced anywhere" question, which answers most pruning decisions without runtime instrumentation.
Maintenance. Adopting the package transfers an orphaned codebase to us. Budget a recurring line item for dependency bumps and framework-major upgrades, or accept that it will rot and be ripped out within 18–24 months. A native build is ~200 lines we control and can test.
Support. No upstream maintainers, no issue tracker with activity, no SLAs, no security advisories. Internal self-support only. For a tool that reads production traffic metadata, that means we also own the failure triage.
Scaling. The design pattern (write-on-request) is the part that will hurt at scale, regardless of language. Risks: write amplification on high-RPS endpoints, table growth without a retention policy, lock contention on hot paths. Mitigations: buffer in memory and flush on terminate, sample at a configurable rate, aggregate into per-day rollups, and set a hard retention window (e.g., 30–90 days). Route instrumentation should never sit on a latency-sensitive path unguarded.
Failure modes to design against:
route:cache and closure-based routes can break name resolution or produce unnamed routes — the manifest must tolerate nulls.Ramp-up. Low for the concept, near-zero for the specific package — there is no documentation, no examples, and no community to consult. A mid-level Laravel engineer can implement the recommended native approach in under a week with existing team patterns. The real ramp-up cost is organizational: agreeing on the observation window and on who authorizes route deletion.
Recommendation. Do not add symplify/symfony-route-usage as a dependency. Close it out as a design reference only. Approve a scoped native build (2–4 engineer-days) or, preferably, first confirm whether existing observability tooling already answers the underlying question — in which case the correct decision is to spend nothing.
How can I help you explore Laravel packages today?