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
Domain Routing Bundle

Domain Routing Bundle Laravel Package

geek-hub/domain-routing-bundle

Geek Hub Domain Routing Bundle adds domain-aware route registration to Laravel, letting you map routes to specific hostnames or subdomains. Configure domains and route groups to serve separate sections of your app from different domains without duplicating route definitions.

View on GitHub
Deep Wiki
Context7

This bundle include routing appropriately to domain specified in configuration

Frequently asked questions about Domain Routing Bundle
Can I install geek-hub/domain-routing-bundle in a Laravel application?
No. It is a Symfony bundle built around Symfony's DependencyInjection extension, configuration tree, and HttpKernel/RouterListener request lifecycle, and Laravel does not consume those extension points. Composer may download the files, but nothing wires into Laravel's container or router, so you end up with dead autoloaded weight. Use Laravel's native Route::domain() and domain route groups instead.
How does domain-based routing work in Laravel without this package?
Laravel supports host-scoped routes natively through Route::domain('{account}.example.com'), the domain key on route groups, subdomain parameter binding, and Route::pattern() for host constraints. The incoming host is resolved automatically from the request, so no extra package is required. If you want configuration-driven domain-to-route-file mapping, loop over a config array inside RouteServiceProvider::boot().
What is the Symfony equivalent of Laravel's Route::domain()?
In Symfony, host matching is expressed with the host condition on route definitions, including host placeholders and host requirements. This bundle adds configuration-driven mapping of domains and wildcard subdomains to route collections on top of Symfony's routing component. If you are working in Symfony, evaluate it there rather than treating it as a Laravel dependency.
How do I install and configure geek-hub/domain-routing-bundle?
In a Symfony app you would require the bundle with Composer, enable it in bundles.php or the Kernel, and configure domains, host matching, wildcard support, defaults, and requirements under the bundle's configuration key. There is no equivalent installation step in Laravel because the bundle's DI extension is never loaded. Read the repository README for the exact configuration schema if you are using it as a reference implementation.
Is geek-hub/domain-routing-bundle maintained and safe for production?
The adoption signals are effectively zero: no stars, no dependents, no release cadence, no issue history, no security disclosure process, and a likely bus factor of one. Domain routing is a security-relevant surface because the untrusted Host header decides which routes and middleware apply. Unvetted code in that path risks cross-tenant routing, cache poisoning, and silent fallback that serves one tenant's content on another tenant's hostname, so it is not a safe production dependency.
Which Laravel versions support domain routing and subdomain parameters?
Route::domain(), domain route groups, subdomain parameter binding, and Route::pattern() host constraints have been available since the Laravel 5.4 era and remain in current Laravel releases. Because these are framework-native features, there is no third-party compatibility matrix to track. This package publishes no Laravel support matrix at all, which is another reason it does not belong in a Laravel dependency list.
How do I test domain-based routes in Laravel?
Use feature tests that pass a full URL including the host, for example $this->get('http://tenant1.example.com/path'), so Laravel resolves the correct domain group. Assert route matching, middleware application, and fallback behavior per host. Test the unknown-host fallback explicitly, because a silent fallback to a default domain is the highest-risk failure mode in multi-tenant routing.
Will route caching break my domain routes?
Native Laravel domain groups cache deterministically with route:cache. A config-driven loop that registers route files per domain can break caching if it generates unstable or duplicate route names, and the failure is silent: domains get dropped and the problem appears only in production. Generate stable, domain-prefixed route names and verify with route:list and route:cache in CI.
What are the alternatives to geek-hub/domain-routing-bundle?
For Laravel, the native Route::domain() API plus a small config/domains.php loop in RouteServiceProvider is the direct alternative and adds no dependency. For Symfony, use native host conditions on routes or a maintained routing bundle with an active release cadence. The honest use of this repository is as a reference implementation: read its configuration schema and route-partitioning approach, then mirror them natively.
How do I map multiple domains to separate route files in Laravel?
Create a config/domains.php map of domain to route file, prefix, middleware, and fallback, then loop over it in RouteServiceProvider::boot() and call Route::domain($domain)->group(base_path($file)) for each entry. Assign a unique name prefix per domain so route caching stays deterministic. Add a test for every host and an explicit fallback for unknown hosts to avoid cross-tenant leakage.
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
shitoudev/permissionmanager