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

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

piotrpolak/conditional-routing-bundle adds conditional routing to your PHP application, letting a single route resolve differently depending on the incoming request. Instead of duplicating route definitions, you attach conditions—such as host, path prefix, headers, or custom callbacks—and the bundle selects the matching target automatically.

This keeps routing configuration declarative and maintainable, especially for multi-tenant, multi-domain, or feature-flagged applications where the same URL must behave differently per context.

  • Condition-based matching on host, path, headers, or custom logic
  • Single source of truth for routes with multiple targets
  • Extensible with your own condition implementations
  • Framework-native integration with minimal configuration
  • Predictable resolution with clear precedence rules
Frequently asked questions about Conditional Routing Bundle
Is piotrpolak/conditional-routing-bundle a Laravel package or a Symfony bundle?
It is a Symfony bundle, not a Laravel package. The repository name and description both refer to selectively loading Symfony bundle routes, and there is no documented Laravel service provider, facade, or config publishing flow. Laravel teams should treat it as a Symfony dependency that needs a bridging layer or a Laravel-native alternative.
How do I install conditional-routing-bundle with Composer?
Install it with composer require piotrpolak/conditional-routing-bundle and confirm the exact package name casing that Composer resolves to. In Symfony you then enable the bundle in your kernel or bundles.php configuration. In Laravel there is no documented auto-discovery path, so verify integration manually before committing.
Does ConditionalRoutingBundle support Laravel 9, 10, 11, or 12?
There is no documented Laravel version support in the available evidence, which is limited to the 1.0.0 release note. The package is described as a Symfony bundle, so Laravel 9 through 12 compatibility is unproven. Run a short integration spike on your exact PHP and Laravel versions before adopting it.
What does ConditionalRoutingBundle actually do for route matching?
It lets you attach user-defined conditions to routes so matching depends on runtime logic such as request attributes, user state, or environment. That makes it useful for feature flags, A/B routing, and context-aware endpoints. The conditions are evaluated in your application's routing layer rather than hard-coded into static route files.
Which PHP versions does conditional-routing-bundle officially support?
The release note claims the package was reviewed and retested for all PHP versions, but that phrasing is ambiguous. Require a precise supported PHP matrix, CI evidence, and upgrade notes from the maintainer. Without that, assume only the versions exercised in your own test suite are proven safe.
Is the Piotrpolak to PiotrPolak rename a breaking change?
A case-only rename is the main technical risk because Composer names are typically normalized to lowercase while PSR-4 autoload paths are case-sensitive on Linux filesystems. Confirm whether the change affects the Composer package name, PHP namespace, PSR-4 paths, config keys, facade aliases, published files, or only branding. Test on a case-sensitive filesystem before upgrading.
Is version 1.0.0 of conditional-routing-bundle semver-stable?
A 1.0.0 tag suggests stability, but there is no changelog or migration guide in the available evidence. Breaking changes from prior 0.x usage cannot be ruled out. Pin the version in composer.lock and document a rollback path before production use.
How should I test ConditionalRoutingBundle in a Laravel application before production?
Allocate a 0.5 to 1 day integration spike using your exact PHP and Laravel versions, including a case-sensitive Linux filesystem check. Install with a targeted Composer update, clear config and cache, and run your application test suite plus route smoke tests. Then canary to production, pin the version, and document rollback steps.
What are the alternatives for conditional or feature-flag routing in Laravel?
Laravel developers usually handle conditional routing with middleware, route groups, custom route service provider logic, or a feature-flag package such as Laravel Pennant. Those options stay inside the Laravel ecosystem and avoid Symfony bundle bridging. Choose them unless you specifically need this bundle's condition-based route loading semantics.
Does conditional-routing-bundle require migrations, config publishing, or queue work?
There is no evidence of migrations, queue jobs, or heavy boot logic in the available material, and a routing bundle is typically config-only. Still, confirm by inspecting composer.json, the bundle extension class, and the README for published config or assets. Verify it does not add per-request database calls or facade overhead in your application.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource