PHPackages                             asker/rocket-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. asker/rocket-router

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

asker/rocket-router
===================

A fast and flexible PHP router package with attribute-based routing and automatic route generation

v1.4.0(6mo ago)17MITPHPPHP ^8.0

Since Sep 19Pushed 2mo agoCompare

[ Source](https://github.com/rocket-php/router)[ Packagist](https://packagist.org/packages/asker/rocket-router)[ Docs](https://github.com/asker26/rocket-router)[ RSS](/packages/asker-rocket-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

RocketRouter
============

[](#rocketrouter)

A framework-agnostic PHP library for attribute-based routing. Scans controller classes at build time, generates a cache with zero runtime reflection.

Installation
------------

[](#installation)

```
composer require asker26/rocket-router
```

Features
--------

[](#features)

- **Attribute-based routing** using PHP 8+ attributes
- **Framework-agnostic** — works with WordPress, Laravel, or any PHP framework
- **Zero runtime reflection** — all scanning happens at build time
- **OPcache-friendly** — routes are cached as a native PHP file
- **Parameter binding** via `#[FromRoute]`, `#[FromBody]`, `#[FromQuery]`

Usage
-----

[](#usage)

### 1. Define Controllers

[](#1-define-controllers)

```
