leaseweb/default-routing-bundle
LeaseWeb DefaultRoutingBundle provides a sensible default routing setup for Symfony applications, using conventions and reusable route definitions to reduce boilerplate, keep controller routes consistent, and simplify routing configuration across PHP projects.
Architecture fit — poor, and the premise needs correcting. leaseweb/default-routing-bundle is a Symfony 2 bundle, not a Laravel package. It hooks the Symfony HTTP kernel via event listeners, registers services in the Symfony DI container, and relies on symfony/symfony routing internals (RouteCollection, RequestContext, RouterInterface). Laravel's router is a separate implementation with its own middleware pipeline and route registrar. There is no adapter seam; the bundle's opinions (default route resolution, relative URL generation, default template selection) are expressed in Symfony idioms that do not translate mechanically. Treat this as a reference design, not a dependency.
Integration feasibility — effectively zero for direct installation. The bundle's composer constraints target symfony/symfony ~2.x and PHP ~5.5. Laravel 10/11 pulls symfony/* ^6/^7. Composer will refuse to resolve both trees in one vendor directory, and no maintainer is going to widen the constraints (last release 2016-06-11). Attempting an isolated install to "just read the code" is fine; attempting to load it in a Laravel app is not.
Technical risk — high and mostly non-technical.
Key questions for the team.
route() helper and route-group prefixes?Stack fit — language-level only. Both are PHP; nothing else aligns. Symfony bundle conventions (Extension classes, services.yml, compiler passes, kernel event priorities) have no Laravel counterpart. Budget for a clean-room reimplementation using Laravel primitives, with the bundle as a specification document.
Migration path — concept port, not code port.
Route::fallback() and implicit binding cover most of the intent.URL::defaults(), and a request-scoped context object. Most "relative" semantics collapse into URL::defaults plus a middleware that sets the current tenant/locale segment.theme::pages.show → pages.show → errors.404). This is the lowest-risk piece and can be shipped first.Compatibility — nil. No PSR-4 autoload interop issue per se, but the transitive dependency graph is incompatible with any supported Laravel version. Do not attempt a shim; the effort exceeds reimplementation.
Sequencing.
php artisan route:cache, 404 fallback loops, tenant isolation.Maintenance — we own it entirely from day one. There is no upstream to patch, no fork to rebase on, and no community to catch regressions. Any internal port becomes a permanently staffed internal package. That is acceptable for ~200 lines of routing logic; it is not acceptable if the port grows into a framework-shaped abstraction.
Support — none. No maintainer response, no issue triage, no documentation beyond a README written for Symfony 2 developers. On-call engineers will be reading source, not docs.
Scaling. The routing layer itself is cheap. The risk is in how default resolution is implemented: if the resolver performs a database lookup per request to determine a default entity or template, that is a per-request query on every unmatched route. Mitigate with aggressive route/config caching and a precomputed slug→resource map. Relative URL generation is CPU-trivial but must be deterministic under cache — non-deterministic context injection will fragment the route cache.
Failure modes to design against.
route:cache in deployments.Ramp-up. Low volume of code, high conceptual friction. Laravel developers will find Symfony 2 listener/compiler-pass idioms unfamiliar, and the absence of docs means the ramp is "one engineer reads the source and writes the spec." Estimate half a day for a senior engineer to fully characterize the behavior, then the reimplementation cost sits with the owning team. Recommended disposition: read, extract requirements, do not depend.
How can I help you explore Laravel packages today?