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

mezon/router

Mezon Router is a fast, lightweight routing library for PHP with support for route groups, middleware, controllers, and RESTful routes. It provides a simple API for defining and dispatching routes, making it a flexible choice for small to medium PHP applications.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy on the routing layer. Routing looks commodity until you hit the edge cases — optional segments, method disambiguation, route groups, URL generation. Evaluating mezon/router forces the explicit question: is dispatch logic something we maintain, or something we adopt and pin? The answer should be documented once per service, not relitigated per sprint.
  • Framework footprint / "Laravel-lite" scope. For a service, CLI tool, or webhook receiver that does not need the full HTTP kernel, this package is a credible substrate for a minimal front controller. It supports the roadmap decision about how thin we can push our own framework surface before we start rebuilding Laravel badly.
  • Latency-sensitive feature slots. Health checks, API gateways, internal microservices, and edge endpoints where cold start and match time matter are candidates for a head-to-head benchmark. Note the honest caveat for the PM: routing is rarely the bottleneck in a Laravel app — the win has to be measured, not assumed.
  • Legacy modernization, incrementally. Replacing switch/include-based dispatch in an older PHP codebase is a contained, low-blast-radius improvement that does not commit us to a framework migration.
  • Vendor and supply-chain policy. The package is small enough to fork or vendor outright. That makes it a useful test case for our policy on single-maintainer dependencies in critical paths.
  • Ecosystem signal-gathering. 271 stars and zero dependents is a deliberate low-coverage choice. We either adopt it with eyes open and an exit path, or we run the spike, learn the number, and build our own.

When to Consider This Package

Consider it when:

  • The target is PHP-native and not committed to Laravel's HTTP kernel. Where we already run Laravel, the default answer is Laravel's router — route caching, middleware, model binding, signed URLs, and auth are wired into it, and swapping means reimplementing them.
  • Footprint and dispatch speed are stated requirements and can be proven with a reproducible benchmark on our PHP version and our route volume.
  • Routing needs are conventional: static paths, typed parameters, HTTP verbs, simple grouping. No dependency on framework-specific behavior.
  • The team can own a small, forkable dependency — pinned version, CI watching upstream releases and advisories, documented fallback.
  • It lands in a bounded surface (one service, a CLI entry point, a prototype) where ripping it out is a day's work.

Look elsewhere when:

  • You need a real middleware pipeline, route caching, named-route URL generation, signed URLs, or model binding. Laravel's router and Symfony Routing carry these natively; FastRoute is the safer small-and-fast alternative with more ecosystem validation.
  • Long-term support matters and there is no internal owner willing to patch a fork. Single maintainer, low stars, zero dependents means no natural successor if the author steps away.
  • You require PSR-7/PSR-15 integration, OpenAPI generation, or typed route definitions out of the box.
  • Security review needs an established CVE and disclosure history for a component that sits in front of every request.
  • The win over the incumbent hasn't been demonstrated in our environment. "Small and fast" is the vendor's claim until our benchmark says otherwise.

How to Pitch It (Stakeholders)

To executives: This is a tiny, focused library that does exactly one job — decide which code handles an incoming URL — with very little code and overhead. It's attractive on cost: cheap to adopt, cheap to remove, and it lets us ship lightweight services without dragging in a full framework. The trade-off is support. It has a modest community and effectively no downstream dependents, so we treat it as a contained bet on a bounded surface, not a platform commitment. The proposal is a two-week spike with a benchmark against our current router and a written exit plan. If it wins on measured dispatch time and simplicity, we cut framework overhead on the services that need it. If it doesn't, we've spent a spike, not a quarter.

To engineering: Adopt behind our own thin Router interface so the dependency is swappable, and pin the version with a CI job watching upstream releases and advisories. Vendor the source if anything critical depends on it. Benchmark against Laravel's native router and Symfony Routing on our PHP version, our route counts, and our middleware needs — and measure route registration cost, not just request throughput. Where we already run Laravel, default to the built-in router and do not swap it; where we don't, this is a legitimate option alongside FastRoute. The real risks are the ones that bite silently: lost middleware guarantees, inconsistent 404/405 semantics, auth or CSRF assumptions bypassed, and two divergent route definitions drifting apart. So the integration surface stays small, every migrated route gets a smoke test, protected endpoints get negative security tests, and nothing customer-facing ships before the benchmark and the rollback plan are written down.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
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