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

Router Laravel Package

hoa/router

Hoa\Router is a standalone PHP routing component for mapping HTTP and CLI requests to handlers. It offers route patterns, variable constraints, HTTP method matching, and flexible callbacks, making it easy to build clean, maintainable routing layers for custom PHP applications.

View on GitHub
Deep Wiki
Context7

The Hoa\Router library.

Frequently asked questions about Router
What is hoa/router used for?
Hoa\Router is a standalone, framework-agnostic PHP routing library for HTTP and CLI applications. It maps incoming requests to declaratively defined rules using HTTP methods, constraints, dynamic variables and optional parameters, then disambiguates and dispatches the best match. It is a reasonable fit for custom PHP microservices, CLI tools and REST APIs that are not built on a full-stack framework. It is not a drop-in replacement for a framework dispatch layer.
How do I install hoa/router with Composer?
You install it with composer require hoa/router, and Composer resolution is generally fine. The catch is that the package was archived with a last release dated 2017-01-14, so it pulls abandoned Hoa transitive dependencies. Audit those dependencies for abandonment and confirm resolution on your target PHP version before committing to it in a real project.
Does hoa/router support PHP 8 and modern Laravel versions?
PHP 8.x compatibility is unverified and there are no upstream PHP version support guarantees. Expect to need a fork to address dynamic properties, removed curly-brace string offsets, each() and other deprecations. There is also no declared Laravel version support, because the package has no Laravel integration at all. Run the upstream test suite on your target PHP before assuming it works.
Can I use hoa/router in a Laravel application?
Technically yes, practically it is unattractive. Hoa sits outside the HTTP kernel and only returns a matched rule plus extracted variables, while Illuminate\Routing\Router owns route registration, the middleware pipeline, controller resolution, route model binding, named-route URL generation, signed URLs and route caching. Adopting it means either running two routers or rebuilding the dispatch layer around it, which is multi-week work for a senior Laravel engineer. If Laravel's native router already satisfies your requirement, stay with it.
How does hoa/router differ from Laravel's native router?
Laravel's router is a dispatch contract; Hoa is a matcher. Rule semantics also differ subtly: trailing slashes, 404 versus 405 handling, optional segments and host or subdomain rules will not map one to one. Hoa is event-driven and extensible through buckets and hoppers, which gives fine-grained control over resolution but does not reproduce Laravel conventions. Silent behavioral drift is the default outcome unless you build a parity harness.
Does hoa/router support route caching, named routes or the route() helper?
No. Named-route URL generation, signed URLs, route:cache, route model binding and middleware are all Laravel capabilities that Hoa does not provide. Anything Hoa matches must still be dispatched, and any URL generation must be handled elsewhere. This is why an integration must never let Hoa own URL generation, middleware or controller dispatch.
How do I configure hoa/router, and is there a Laravel service provider?
There is no Laravel service provider, facade, config file or published integration pattern, and zero Packagist dependents means no reference implementations to copy. Routes are described declaratively in PHP with methods, constraints and optional parameters, and the architecture is extensible via buckets and hoppers. You would wire it yourself, outside the HTTP kernel, behind your own internal contract.
Is hoa/router maintained and safe to use in production?
It is archived, with the last release in January 2017 and no upstream security patching. The license is permissive BSD-3-Clause, so forking is legally viable, but that also converts your team into the maintainer, including patches and on-call ownership. With roughly 28 stars and no dependents, there is no community support story. Budget for a vendored, patched fork rather than a clean dependency.
How should I test a hoa/router integration in Laravel?
Isolate Hoa behind an internal RouteMatcher contract with two implementations: Laravel native by default and Hoa opt-in per path prefix. Run Hoa in shadow mode against production traffic and compare match results with Laravel's router, gating any cutover on parity metrics. Also build a rule-syntax compatibility matrix and run the upstream test suite on your target PHP. Define rollback and exit criteria before you start.
What are the maintained alternatives to hoa/router?
For framework-agnostic matching, Symfony Routing and FastRoute are the maintained paths with an actual support story. For Laravel applications, the native router is almost always the right answer. Hoa only makes sense for a tightly scoped legacy bridge or a non-Laravel CLI or HTTP service, and for most teams the evaluation correctly terminates at requirements validation.
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