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.
Architecture fit
HttpKernel and RouterListener. None of those extension points are consumed by Laravel's service container, so it cannot be installed as a working dependency in a Laravel app. Any TPM framing that treats this as a Laravel candidate is a category error that should be corrected before it reaches a backlog.Route::domain(), the domain key on route groups, subdomain parameter binding, and Route::pattern() cover the overwhelming majority of the described feature set. The bundle's real differentiator is configuration-driven domain→route-file mapping, which is a short loop over a config array inside RouteServiceProvider::boot().Integration feasibility
config/domains.php map of domain => [route file, prefix, middleware, fallback], iterated in the route service provider, reproduces the behavior with tests in days.RequestContext lifecycle. Laravel wraps Symfony Routing but does not expose the hook points needed to graft a third-party bundle into request dispatch.Technical risk
Host header drives which routes and which middleware apply. Unvetted code in that path risks cross-tenant routing, cache poisoning, and — worst case — silent fallback to a default domain that serves one tenant's content to another tenant's hostname. That is a data-exposure class of incident, not a broken-page class.route:cache will silently drop domains. The failure is quiet and shows up in production, not in development.Key questions
Route::domain() plus a config-driven group loop fail to do?Decision summary: Adopt the pattern; decline the package. Revisit only if a maintained, adopted alternative emerges or the estate gains a Symfony service where host matching is not already idiomatic.
Stack fit
Route::domain() does is negative leverage.Migration path
route:cache run.Compatibility
route:cache assertion a CI gate from day one. This is the single highest-value test for a config-driven domain router, because misconfiguration here fails silently under cache and loudly in production.Vary: Host behavior at the edge during the pilot, not after rollout.Sequencing
RouteServiceProvider pattern) with a route-cache test, an unknown-host test, and a host-allowlist test.Note on the "buy vs. build" framing: this is really adopt vs. replicate, and the cost of replication here is one to two engineering days. At that price, taking on a 0-star dependency in the request lifecycle is not a trade worth making under any plausible weighting.
Maintenance
Support
Scaling
Vary: Host handling. A configuration-driven router turns a single misconfiguration into a fleet-wide outage rather than a single-route defect. Blast radius, not throughput, is the scaling story.Failure modes
Host → 404 at best; silent fallback to a default domain at worst, which is a cross-tenant data exposure. Mitigate with an explicit host allowlist, never a permissive fallback.Host headers → cache poisoning or incorrect tenant routing if the resolver trusts the header without validation.Ramp-up
Recommendation: do not adopt. Treat geek-hub/domain-routing-bundle as a design reference for config-driven domain mapping — extract its config schema and edge-case list, implement the behavior natively in RouteServiceProvider with an explicit host allowlist and a route-cache CI gate, and revisit only if the requirement proves materially broader than domain-keyed route grouping or the estate acquires a supported Symfony surface that already has an owner.
How can I help you explore Laravel packages today?