piotrpolak/conditional-routing-bundle
Symfony bundle that adds conditional routing, letting you define routes that match only when configured conditions are met. Useful for feature flags, environment-specific endpoints, and request-aware route selection, with simple routing configuration and integration with Symfony's routing component.
if blocks in controllers. That keeps flag logic auditable in one place and cheap to remove once a rollout graduates.conditional-routing-bundle, Symfony routing/config integration). Do not slot it into a Laravel roadmap; the service provider / facade / config/app.php guidance in the provided notes is generic boilerplate that does not apply here. If your stack is Laravel, the correct decision is "no" and the correct alternative is Laravel middleware or a route-level flag.Consider it when:
Look elsewhere (or build in-house) when:
if in a route loader would do. Conditional routing is a pattern, and the pattern is cheap; the dependency is not.Adoption criteria before any code is written: confirmed Symfony version compatibility, a passing integration spike on your exact PHP/Symfony pair, a named internal owner, a fork-or-vendor plan, and a rollback path. If any of those are missing, the answer is "not yet."
To executives (one paragraph): This is a small, MIT-licensed Symfony component that lets us switch groups of application routes on and off based on the incoming request, instead of hard-coding that logic throughout the codebase. It directly supports staged rollouts and tenant-specific surfaces, and it would cost us roughly a day to evaluate. The catch is that it is a low-traffic, single-maintainer project last released in 2018, so we would be adopting code rather than buying support — which means we either budget a small amount of engineering to own a fork, or we spend a comparable amount writing the equivalent logic ourselves and keep full control. My recommendation is to treat it as a design reference and a one-day spike, not a standing dependency, unless the Symfony-version check passes cleanly.
To engineering leadership: The strategic value is the pattern — declarative, centralized route visibility — not the artifact. The artifact is stale, thinly adopted, and unmaintained; the pattern is sound and takes little effort to reproduce internally. Approve a timeboxed spike, require a compatibility check against our Symfony version, and default to an in-house loader unless the bundle proves both compatible and meaningfully cheaper than the ~100 lines it would take to replace.
To the engineering team: Do not pull this in blind. Confirm the Symfony version matrix, confirm it is not doing per-request database work, and confirm the route-loading hooks still exist in our version. Also note the packaging history — a case-only namespace rename (Piotrpolak → PiotrPolak) that breaks PSR-4 autoloading on case-sensitive filesystems — which is a warning sign about release hygiene. If we adopt, pin it, vendor it, and assign an owner.
How can I help you explore Laravel packages today?