PHPackages                             israel-nogueira/fast-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. israel-nogueira/fast-router

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

israel-nogueira/fast-router
===========================

Modern, fast and flexible PHP router with support for static and instance modes, middleware chains, and advanced routing features

v2.0.2(2mo ago)1761[1 PRs](https://github.com/israel-nogueira/fast-router/pulls)GPL-3.0-or-laterPHPPHP &gt;=8.1

Since May 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/israel-nogueira/fast-router)[ Packagist](https://packagist.org/packages/israel-nogueira/fast-router)[ RSS](/packages/israel-nogueira-fast-router/feed)WikiDiscussions fast-router-v2 Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (9)Used By (0)

🚀 Fast Router
=============

[](#-fast-router)

[![Latest Version](https://camo.githubusercontent.com/f6cc2537c289cdc9445bc7f9e7ee2ad0968451ce9ced19997533744c8ce617a3/68747470733a2f2f706f7365722e707567782e6f72672f69737261656c2d6e6f6775656972612f666173742d726f757465722f762f737461626c652e737667)](https://packagist.org/packages/israel-nogueira/fast-router)[![Total Downloads](https://camo.githubusercontent.com/cd6c153c4f49ace7b1aa00bce170253739565f23b2dabc79f23645fa92dca8b9/68747470733a2f2f706f7365722e707567782e6f72672f69737261656c2d6e6f6775656972612f666173742d726f757465722f646f776e6c6f616473)](https://packagist.org/packages/israel-nogueira/fast-router)[![License](https://camo.githubusercontent.com/332ac3a6190ac9812c1a3c7ef2920030518e1b5ee84a672050115665b4a184b0/68747470733a2f2f706f7365722e707567782e6f72672f69737261656c2d6e6f6775656972612f666173742d726f757465722f6c6963656e73652e737667)](https://packagist.org/packages/israel-nogueira/fast-router)[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://php.net/)

Modern, fast and flexible PHP router with support for **static** and **instance** modes, middleware chains, route groups, and advanced routing features.

---

✨ Features
----------

[](#-features)

- ✅ **Dual Mode**: Static (auto-dispatch) and Instance (manual control)
- ✅ **Route Parameters**: Simple `{id}` and regex `{id:\d+}` with optional parameters
- ✅ **Route Groups**: Nested groups with prefix and middleware inheritance
- ✅ **Middleware Chain**: Elegant middleware system with dependency injection
- ✅ **Multiple HTTP Methods**: GET, POST, PUT, DELETE, PATCH, OPTIONS, ANY, and custom
- ✅ **Controller Support**: String syntax, array syntax, and closures
- ✅ **Named Routes**: Reference routes by name (coming soon)
- ✅ **PSR-4 Autoloading**: Modern namespace structure
- ✅ **Type Safety**: Full PHP 8.1+ type hints
- ✅ **Zero Dependencies**: Standalone library
- ✅ **Debug Mode**: Built-in debugging capabilities

---

📦 Installation
--------------

[](#-installation)

```
composer require israel-nogueira/fast-router
```

### Requirements

[](#requirements)

- PHP &gt;= 8.1
- Composer

---

🚀 Quick Start
-------------

[](#-quick-start)

### Basic Usage

[](#basic-usage)

```
