Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Conditional Routing Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature gating without forking the codebase. If roadmap items depend on turning whole route groups on/off per request context (beta tenants, internal-only back office, regional rollouts, feature-flagged APIs), this package lets you express that declaratively in routing config instead of shipping conditional if blocks in controllers. That keeps flag logic auditable in one place and cheap to remove once a rollout graduates.
  • Build vs. buy for request-aware routing. Writing this in-house in Symfony is genuinely small (a route loader/compiler-pass wrapper plus condition classes), so the decision is less "can we build it" and more "do we want to own it." This package is a buy only if you are already on Symfony and the conditions you need are simple — otherwise the honest answer is a ~100-line internal loader you control.
  • Roadmap sequencing for multi-tenant / staged-rollout work. If conditional routing is on the critical path for a tenant-tier or phased-launch epic, this is a reasonable de-risking spike: one day to prove the pattern, then decide whether to keep the dependency or internalize the pattern.
  • Architecture guardrail. It supports an explicit product-engineering principle: routing and visibility policy belongs in configuration, not scattered across controllers. Useful framing when pushing back on ad-hoc per-endpoint permission checks.
  • Not a Laravel decision. Despite the Laravel-flavored assessment docs attached, this is a Symfony bundle (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.

When to Consider This Package

Consider it when:

  • You are on Symfony (not Laravel) and already comfortable with bundle registration and routing config.
  • You have a recurring, structural need to enable/disable route groups by request context — not a one-time toggle.
  • The conditions are simple and request-local (host, header, user role, environment) and do not require database lookups on every request.
  • You are willing to vendor-pin and potentially fork. At 5 stars, a last release of 2018-10-25, and a score of 0.385, this is effectively unmaintained. Treat it as source code you are adopting, not a dependency you are consuming.

Look elsewhere (or build in-house) when:

  • Your stack is Laravel — wrong ecosystem entirely; use middleware, route groups, or a flag service.
  • You are on modern Symfony (5/6/7). A 2018 bundle predates substantial routing and bundle-system changes; assume it needs porting. Verify against your exact Symfony version before committing.
  • You need dynamic, per-user, database-driven visibility rules — that is authorization, not routing. Use Symfony's security/authorization layer or a feature-flag service (LaunchDarkly, Unleash, Flagsmith). Conflating routing with entitlement checks is how you end up with routes that are "hidden" but still callable.
  • You need maintenance guarantees, security response, or a support contract. There is none here.
  • A single 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."

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource