PHPackages                             monkeyscloud/monkeyslegion-router - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. monkeyscloud/monkeyslegion-router

ActiveLibrary[HTTP &amp; Networking](/categories/http)

monkeyscloud/monkeyslegion-router
=================================

High-performance attribute-driven HTTP router for MonkeysLegion with compiled trie matching, PSR-15 middleware, and route model binding.

2.1.5(1mo ago)12.1k↓29.8%6MITPHPPHP ^8.4

Since Jul 23Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/MonkeysCloud/MonkeysLegion-Router)[ Packagist](https://packagist.org/packages/monkeyscloud/monkeyslegion-router)[ RSS](/packages/monkeyscloud-monkeyslegion-router/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (18)Versions (18)Used By (6)

MonkeysLegion Router v2
=======================

[](#monkeyslegion-router-v2)

High-performance, attribute-driven HTTP router for the MonkeysLegion framework.

**PHP 8.4+ required** • PSR-7/15 compliant • Compiled trie matching

Features
--------

[](#features)

FeatureDescription**Compiled Trie Matching**O(1) static path lookup, O(k) regex for parametric routes, method-indexed**PSR-15 Middleware**Pure `Psr\Http\Server\MiddlewareInterface` pipeline, priority-based, cursor dispatch**Attribute-Driven**`#[Route]`, `#[RoutePrefix]`, `#[Middleware]`, `#[ApiResource]`, `#[Throttle]`, `#[WithoutMiddleware]`**Controller Auto-Scanning**Zero-config directory scanning for annotated controllers**Auto-CRUD**`#[ApiResource]` generates 5 RESTful routes automatically**Route Model Binding**Objects with `id`, `getRouteKey()`, or `BackedEnum` auto-resolved in URL generation**Signed URLs**HMAC-SHA256 signed URLs with expiration support**Route Cache**Compiled routes cached as PHP files with OPcache warm-up**Rate Limiting**Per-route `#[Throttle]` attribute with IP/user/route strategies**HEAD/OPTIONS**Automatic HEAD delegation and OPTIONS responses**Domain Constraints**Per-route or per-group domain restrictions**Route Debugger**CLI-friendly route listing, filtering, and `match()` testingInstallation
------------

[](#installation)

```
composer require monkeyscloud/monkeyslegion-router "^2.0"
```

Quick Start
-----------

[](#quick-start)

```
